SlideShare a Scribd company logo
1 of 24
Download to read offline
Daniel Wanja
Tony Hillerson
We wrote a
                     book!

• Yea, us!
• What the heck?
Why Flex on Rails?

• You already know “why Rails?”
• Flex is another tool in the toolbox
• Service oriented
Agenda

• A bit about Flex
• Highlights and source from the book
• Drinking
Flex is...


• Part of Adobe’s Flash platform
• Open Source (framework) and free
Flex is...

• A compiler
• An XML language - MXML
• A set of components
Flex ...

• A way to write ActionScript declaratively
• Compiles to ActionScript
• ActionScript -> SWF
• Runs in the Flash Player
Flex on Rails
 • Compiled source - keep
   separate
 • SWF -> /public during
   deployment
 • Flex talks to Rails with
   XML, JSON, or AMF
Development
        Workflow
• Open SWF or HTML Wrapper from Public
• HTML Wrapper - can use relative urls
• SWF - Hardcode localhost:3000 :-(
• Either - Load an url from config :-)
Codes!
    git@github.com:danielwanja/flexonrails.git
•   Passing Data with XML
•   RESTful Services
•   Passing Data with AMF
•   Data Visualization
•   Building Flex with Rake
•   Read the Source!
•   Observers in Flex
•   Authentication
•   Hierarchical Data With AMF
•   Advanced Data Grid with Awesome Nested Set
•   Server Push with Juggernaut
•   Flex and Javascript
•   File Upload
Passing Data with XML
 Rails        Person.new(:first_name => 'daniel', :last_name =>
              'wanja').to_xml


          var person:XML = <person>
 Flex     <first_name>tony</first_name>
          <last_name>hillerson</last_name></person>


Getting   <mx:HTTPService id=quot;indexquot;
            url=quot;http://localhost:3000/people.xmlquot;
XML to      resultFormat=quot;e4xquot; />

 Flex     index.send()

          <mx:HTTPService id=quot;updatequot;
            url=quot;http://localhost:3000/people/{id}.xml?_method=putquot;
Sending     contentType=quot;application/xmlquot;
            resultFormat=quot;e4xquot;
XML to      method=quot;POSTquot;

 Rails      result=quot;index.send()quot; />



                                                                      02
          update.send(person)
RESTful Services
HTTP verb                   URL                                 Controller



GET         /accounts/:account_id/positions       {:action=>quot;indexquot;,
                                                  :controller=>quot;positionsquot;}


POST        /accounts/:account_id/positions       {:action=>quot;createquot;,
                                                  :controller=>quot;positionsquot;}


GET         /accounts/:account_id/positions/:id   {:action=>quot;showquot;,
                                                  :controller=>quot;positionsquot;}


PUT         /accounts/:account_id/positions/:id   {:action=>quot;updatequot;,
                                                  :controller=>quot;positionsquot;}


DELETE      /accounts/:account_id/positions/:id   {:action=>quot;destroyquot;,
                                                  :controller=>quot;positionsquot;}




                                                                              03
Nested Resources
class Account < ActiveRecord::Base   class Position < ActiveRecord::Base class Movement < ActiveRecord::Base
  has_many :positions,                 belongs_to :account                 belongs_to :position
           :dependent => :destroy      has_many :movements,              end
end                                             :dependent => :destroy
                                     end




             /accounts/:id

                               /accounts/:account_id/positions/:id                      

                           /accounts/:account_id/positions/:position_id/movements/:id
Data Visualization




                     07
Authentication

• All Flex service calls go through the
  browser
• AIR manages cookies
• = Standard cookie based credentials work
  fine
Hierarchical Data with
        AMF

• Works nicely with Awesome Nested Set
• Good for retrieving Object Graphs
• More work when sending Object Graphs
Read the Source!


• Flex source is available in Flex Builder
• MXML is compiled to ActionScript
Observers in Flex

• Binding is sweet
• {} notation
• BindingUtils
• ChangeWatcher
Building Flex with Rake


• Simple shell command to mxmlc
• mxmlc needs to be in the path
Flex and Javascript

• HTML *and* Flex is sometimes the right
  answer
• Flex Ajax Bridge
• ExternalInterface
Advanced Data Grid with
              Awesome Nested Set
class Category < ActiveRecord::Base
  acts_as_nested_set
  def full_xml(builder=nil)
    xml = builder ||= Builder::XmlMarkup.new(:indent => 2)
    xml.category(:id => id,
                 :name => name,
                 :description => description,
                 :qty_in_stock => qty_in_stock) do
      children.each { |child| child.full_xml(xml) }
    end
  end
end




 <mx:HTTPService id=quot;categoriesquot; url=quot;http://localhost:3000/categoriesquot; resultFormat=quot;e4xquot; />




                                                                                            18
Server Push with Juggernaut

     message to socket




                                                                                 localhost:3000/
                                                            1. post to http://
      3. push JSON




                                     Nt




                                                                                    messenger/
                                   O cke




                                                                                      message
                                 JS so
                               h
                             us e to
                           p
                         3. sag
                           es
                         m




                           2. send_to_channels
       Juggernaut
                                                 Rails Application
       Push Server




                                                                                                   20
Server Push with Juggernaut
                                                                                         class MessengerController <
                                                                                         ApplicationController
                                                                                           def message
                                                                                             data = {:user => params[:user], :message =>
                                                                                         params[:message]}
             message to socket




                                                                    localhost:3000/
                                                                    1. post to http://
              3. push JSON




                                            Nt




                                                                       messenger/
                                           O ke




                                                                         message
                                         JS soc
                                       h
                                     us to
                                  . p age
                                                                                         Juggernaut.send_to_channel(data, :im_channel)
                                 3s
                                   es
                                 m

                                                                                             render :nothing => true
                                                                                           end
                                   2. send_to_channels
                                                                                         end
               Juggernaut
                                                         Rails Application
               Push Server




<mx:HTTPService id=quot;sendMessagequot; url=quot;http://
                                                                                         <net:XMLSocket id=quot;socketquot;
localhost:3000/messenger/messagequot;
                                                                                               connect=quot;connectHandler(event)quot;
        method=quot;POSTquot; result=quot;msg.text=''quot;
                                                                                               data=quot;dataHandler(event)quot;
fault=quot;mx.controls.Alert.show(event.fault.faultS
                                                                                               close=quot;closeHandler(event)quot;
tring);quot;>
                                                                                               ioError=quot;ioErrorHandler(event)quot;
  <mx:request xmlns=quot;quot;>
    <user>{user.text}</user>
                                                                                         securityError=quot;securityErrorHandler(event)quot; />
    <message>{msg.text}</message>
  </mx:request>
                                                                                         socket.connect(hostName, port);
</mx:HTTPService>
File Upload
                                                 class Asset < ActiveRecord::Base
<net:FileReference id=quot;fileReferencequot;              has_attachment :storage => :file_system
    select=quot;selectHandler(event)quot; />             end

private function selectHandler(event:Event):void class AssetsController < ApplicationController
{                                                   def create
  var request:URLRequest =                              @asset = Asset.new(params[:asset])
  new URLRequest(quot;http://localhost:3000/assetsquot;)        if @asset.save
  var uploadDataFieldName:String =                        render(:nothing => true, :status => 200)
                           'asset[uploaded_data]'       else
  fileReference.upload(request,                           render(:nothing => true, :status => 500)
                            uploadDataFieldName);       end
}                                                   end
                                                  end




                                                                                               22

More Related Content

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Flexonrails Derailed Talk

  • 2. We wrote a book! • Yea, us! • What the heck?
  • 3. Why Flex on Rails? • You already know “why Rails?” • Flex is another tool in the toolbox • Service oriented
  • 4. Agenda • A bit about Flex • Highlights and source from the book • Drinking
  • 5. Flex is... • Part of Adobe’s Flash platform • Open Source (framework) and free
  • 6. Flex is... • A compiler • An XML language - MXML • A set of components
  • 7. Flex ... • A way to write ActionScript declaratively • Compiles to ActionScript • ActionScript -> SWF • Runs in the Flash Player
  • 8. Flex on Rails • Compiled source - keep separate • SWF -> /public during deployment • Flex talks to Rails with XML, JSON, or AMF
  • 9. Development Workflow • Open SWF or HTML Wrapper from Public • HTML Wrapper - can use relative urls • SWF - Hardcode localhost:3000 :-( • Either - Load an url from config :-)
  • 10. Codes! git@github.com:danielwanja/flexonrails.git • Passing Data with XML • RESTful Services • Passing Data with AMF • Data Visualization • Building Flex with Rake • Read the Source! • Observers in Flex • Authentication • Hierarchical Data With AMF • Advanced Data Grid with Awesome Nested Set • Server Push with Juggernaut • Flex and Javascript • File Upload
  • 11. Passing Data with XML Rails Person.new(:first_name => 'daniel', :last_name => 'wanja').to_xml var person:XML = <person> Flex <first_name>tony</first_name> <last_name>hillerson</last_name></person> Getting <mx:HTTPService id=quot;indexquot; url=quot;http://localhost:3000/people.xmlquot; XML to resultFormat=quot;e4xquot; /> Flex index.send() <mx:HTTPService id=quot;updatequot; url=quot;http://localhost:3000/people/{id}.xml?_method=putquot; Sending contentType=quot;application/xmlquot; resultFormat=quot;e4xquot; XML to method=quot;POSTquot; Rails result=quot;index.send()quot; /> 02 update.send(person)
  • 12. RESTful Services HTTP verb URL Controller GET /accounts/:account_id/positions {:action=>quot;indexquot;, :controller=>quot;positionsquot;} POST /accounts/:account_id/positions {:action=>quot;createquot;, :controller=>quot;positionsquot;} GET /accounts/:account_id/positions/:id {:action=>quot;showquot;, :controller=>quot;positionsquot;} PUT /accounts/:account_id/positions/:id {:action=>quot;updatequot;, :controller=>quot;positionsquot;} DELETE /accounts/:account_id/positions/:id {:action=>quot;destroyquot;, :controller=>quot;positionsquot;} 03
  • 13. Nested Resources class Account < ActiveRecord::Base class Position < ActiveRecord::Base class Movement < ActiveRecord::Base has_many :positions, belongs_to :account belongs_to :position :dependent => :destroy has_many :movements, end end :dependent => :destroy end /accounts/:id /accounts/:account_id/positions/:id /accounts/:account_id/positions/:position_id/movements/:id
  • 15. Authentication • All Flex service calls go through the browser • AIR manages cookies • = Standard cookie based credentials work fine
  • 16. Hierarchical Data with AMF • Works nicely with Awesome Nested Set • Good for retrieving Object Graphs • More work when sending Object Graphs
  • 17. Read the Source! • Flex source is available in Flex Builder • MXML is compiled to ActionScript
  • 18. Observers in Flex • Binding is sweet • {} notation • BindingUtils • ChangeWatcher
  • 19. Building Flex with Rake • Simple shell command to mxmlc • mxmlc needs to be in the path
  • 20. Flex and Javascript • HTML *and* Flex is sometimes the right answer • Flex Ajax Bridge • ExternalInterface
  • 21. Advanced Data Grid with Awesome Nested Set class Category < ActiveRecord::Base acts_as_nested_set def full_xml(builder=nil) xml = builder ||= Builder::XmlMarkup.new(:indent => 2) xml.category(:id => id, :name => name, :description => description, :qty_in_stock => qty_in_stock) do children.each { |child| child.full_xml(xml) } end end end <mx:HTTPService id=quot;categoriesquot; url=quot;http://localhost:3000/categoriesquot; resultFormat=quot;e4xquot; /> 18
  • 22. Server Push with Juggernaut message to socket localhost:3000/ 1. post to http:// 3. push JSON Nt messenger/ O cke message JS so h us e to p 3. sag es m 2. send_to_channels Juggernaut Rails Application Push Server 20
  • 23. Server Push with Juggernaut class MessengerController < ApplicationController def message data = {:user => params[:user], :message => params[:message]} message to socket localhost:3000/ 1. post to http:// 3. push JSON Nt messenger/ O ke message JS soc h us to . p age Juggernaut.send_to_channel(data, :im_channel) 3s es m render :nothing => true end 2. send_to_channels end Juggernaut Rails Application Push Server <mx:HTTPService id=quot;sendMessagequot; url=quot;http:// <net:XMLSocket id=quot;socketquot; localhost:3000/messenger/messagequot; connect=quot;connectHandler(event)quot; method=quot;POSTquot; result=quot;msg.text=''quot; data=quot;dataHandler(event)quot; fault=quot;mx.controls.Alert.show(event.fault.faultS close=quot;closeHandler(event)quot; tring);quot;> ioError=quot;ioErrorHandler(event)quot; <mx:request xmlns=quot;quot;> <user>{user.text}</user> securityError=quot;securityErrorHandler(event)quot; /> <message>{msg.text}</message> </mx:request> socket.connect(hostName, port); </mx:HTTPService>
  • 24. File Upload class Asset < ActiveRecord::Base <net:FileReference id=quot;fileReferencequot; has_attachment :storage => :file_system select=quot;selectHandler(event)quot; /> end private function selectHandler(event:Event):void class AssetsController < ApplicationController { def create var request:URLRequest = @asset = Asset.new(params[:asset]) new URLRequest(quot;http://localhost:3000/assetsquot;) if @asset.save var uploadDataFieldName:String = render(:nothing => true, :status => 200) 'asset[uploaded_data]' else fileReference.upload(request, render(:nothing => true, :status => 500) uploadDataFieldName); end } end end 22