Guest User

Untitled

a guest
Mar 13th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. ## Attempt One
  2. <%= link_to_remote(image_tag('button_details.gif', :id => "details"), :update => "results",
  3. :url => {:controller => "masters", :action => "show"})
  4. %>
  5.  
  6. ## Attempt One Console
  7.  
  8. Parameters: {"action"=>"show", "controller"=>"masters"}
  9. ActiveRecord::RecordNotFound (Couldn't find Master without an ID)
  10.  
  11. ## Attempt Two
  12. <%= link_to_remote(image_tag('button_details.gif', :id => "details"), :update => "results",
  13. :url => {:controller => "masters", :action => "show", :id => contact.id}) %>
  14.  
  15. ## Attempt Two Console
  16.  
  17. Parameters: {"action"=>"4", "controller"=>"masters"}
  18. ActionController::UnknownAction (No action responded to 4):
  19.  
  20. ## Controller
  21.  
  22. def show
  23.  
  24. user = User.find(current_user.id)
  25. @master = user.masters.find(params[:id])
  26.  
  27. respond_to do |format|
  28. format.html # show.html.erb
  29. format.xml { render :xml => @master }
  30. end
  31. end
Add Comment
Please, Sign In to add comment