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 trialMarie Veverka
12,117 PointsDef url_options
Hi There!
Does adding the def url_options to the todo_items_controller break everything for anyone else out there? The only way I can get my tests to run is to delete this whole code snippet:
def url_options
{ todo_list_id: params[:todo_list_id] }.merge(super)
end
Any thoughts?
3 Answers
Marie Veverka
12,117 PointsThanks David!
John Magee
Courses Plus Student 9,058 PointsYeah, I can't make this work and the 'best answer' has two close brackets and one open bracket - can someone explain what is going on - is this an artifact that doesn't work in new versions of rails?
David Gross
19,443 PointsThe reason why it would be breaking if this is exactly how your method is written is because you are missing a bracket } at the end of super.
def url_options
{ todo_list_id: params[:todo_list_id] }.merge(super) }
end
Any thoughts?
• Ruby
Editing Todo Items
Subscribe
Product Team
6,835 PointsThe bracket is closed earlier in the statement.