Guest User

Untitled

a guest
Feb 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. # request json
  2.  
  3. # controller action
  4. def new
  5. respond_to do |format|
  6. format.json do
  7. render :template => "thingy"
  8. end
  9. end
  10. end
  11.  
  12.  
  13. # thingy.json.erb THIS DOESN"T WORK if people/things.html.erb exists
  14. <%=
  15. {
  16. :content => render_to_string(:partial => "people/things")
  17. }
  18. %>
  19.  
  20.  
  21. # thingy.json.erb THIS WORKS
  22. <%=
  23. {
  24. :content => render_to_string(:partial => "people/things.html.erb")
  25. }
  26. %>
Add Comment
Please, Sign In to add comment