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

Benjamin Sunderland
Benjamin Sunderland
4,709 Points

I don't understand where you define 'params' in rails.

For example,

def show @page = Page.find(params[:id]) end

I understand it is finding the ID of the page that is created and showing it. But where in a rails app would you find all the parameters defined as I don't understand code like this.

Please help me! Thanks guys.

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Page.find(params[:id]).

Short answer is that you won't find them on your own Rails app, as they were pre-defined in the Rails' source code. You can consult the Rails doc on how to use 'em; or if you're really good at reading Ruby code, you may check out Rails source at github.