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 Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Editing Todo Items

Marie Veverka
Marie Veverka
12,117 Points

Def 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

Yeah, 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
David Gross
19,443 Points

The 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

The bracket is closed earlier in the statement.