Skip to main content

RuntimeError (can't modify frozen String)

Rails • Asked by Joe Guerra
Db5dfe34e757cbcec46b0a682f272a55

got this runtime error on heroku, it had been working fine...

I traced it down to this

add_breadcrumb 'category / ' << @title, categories_path

in my category controller (I've commented it out for now). Is there an alternative way to concat this so it doesn't cause an error?


E1c4201cc974a033e860f7d7423a9b7f

Db5dfe34e757cbcec46b0a682f272a55

yes, i'm using that gem. Just stopped liking the way I concatenated the breadcrumb.


E1c4201cc974a033e860f7d7423a9b7f

What should add_breadcrumb 'category / ' << @title, categories_path output?


Db5dfe34e757cbcec46b0a682f272a55

it should add / category / + category title to my breadcrumb.


E1c4201cc974a033e860f7d7423a9b7f

How about something like this?

add_breadcrumb "category / #{@title}", categories_path


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 18,000+ developers who get early access to new screencasts, articles, guides, updates, and more.

By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

More of a social being? We're also on Twitter and YouTube.