In RoR, I sometimes see:
render @users
or
render 'new'
How are the two different?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In short,
render @usersis rendering a collection of objects of typeUserwith a partial file named_user.html.erb, andrender 'new'is rendering thenewaction & is equivalent torender :action => new.Best to review the Layouts and Rendering in Rails page in the Ruby on Rails Guides to understand how these two work & where they can be used appropriately, and the various in-built assumptions that make these and many other convenient
rendermethods possible.