def show
render :text => params.inspect
end
What is render :text =>?
What is render, :text, and the =>?
Are they standard ruby?
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.
The syntax you see used in that code snippet is not limited to
render(), but it is common with many other Ruby on Rail methods.The method is accepting a hash map, using a simplified syntax.
The code is equivalent to
Other code snippets that include the same syntax are: