Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Simple Ruby on Rails Application Building the Profile Page Creating the Profiles Controller

Edward Poon
Edward Poon
9,313 Points

What does params[:id] mean?

what does the :id in params do? Is it referencing the id column inside the users database?

I thought we were trying to find the user by their profile names so shouldn't it be params[:profile_name]?

1 Answer

Hi Edward -

The "id" in params references the id of the object (eg., user) that the client wants to work with in some way.

Take a look at this Stackoverflow discussion of params in a Rails app:


Also check out Rails Guide documentation on params: http://guides.rubyonrails.org/action_controller_overview.html

The discussion about params is mid-way down the page.