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

url_options adding to ALL urls

So when we designed the albums and pictures, we added:

def url_options
    { profile_name: params[:profile_name] }.merge(super)
 end

Now, whenever I am on the album or picture page and try to click anywhere else, there is an added

?profile_name = mike_the_frog

to the URL. This only happens if I click a link that is not part of that controller. So if I'm looking at a picture and click the album page, it reverts to a regular URL without the extra attachment.

I'm curious if there is a way to fix this. This seems like it would create problems adding extra params to links that shouldn't have them. Any ideas?

Thanks in advance!

1 Answer

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

That should be fine for most links on the site. Did you run in to any issues anywhere?