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 Rails Routes and Resources Routes to Create Actions Controller Action to Create Pages

Tommy Tayler
Tommy Tayler
11,549 Points

Can't define "params"

HI there, every time I try to set up params it won't let me.

The first step in the video I get a different error message

params = ActionController::Parameters.new(stuff: "%$#@", page: {title: "title", body: "body", slug: "slug", is_admin "true"})
SyntaxError: (irb):13: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
...body", slug: "slug", is_admin "true"})
...                               ^
(irb):13: syntax error, unexpected '}', expecting end-of-input
... slug: "slug", is_admin "true"})
...                               ^

please help

1 Answer

Jay McGavren
STAFF
Jay McGavren
Treehouse Teacher

This part of the error message is your clue:

SyntaxError: (irb):13: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
...body", slug: "slug", is_admin "true"})
...                               ^

See how the ^ character points at (or near) is_admin "true"? It's pointing at an error on the line above. You have a syntax error: there needs to be a : between the is_admin key and the value "true".