Save 36% for Black Friday! Learn more

All threads / RuntimeError (can't modify frozen String)

Ask A Question

Notifications

You’re not receiving notifications from this thread.

RuntimeError (can't modify frozen String)

Joe Guerra asked in Rails

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?

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

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

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

How about something like this?

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

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 39,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.