ID from Controller#show
I would like to retrieve the id of the current item in a Controller#show page. How is this done? I can't seem to fig开发者_运维技巧ure this out or find it anywhere.
You're probably looking for:
<%= params[:id] %>
There are lots of things wrong with doing this, one of which is it can open you up to CSRF attacks. Make sure to escape your output (this is done automatically in rails 3.)
精彩评论