crummy icon indicating copy to clipboard operation
crummy copied to clipboard

Rails 6.1: ActionView::Template::Error: can't modify frozen Hash

Open richardonrails opened this issue 3 years ago • 2 comments

I'm trying to upgrade from Rails 6.0 to 6.1 and suddenly I'm getting this error that seems related to crummy, though I can't figure out what's wrong:

ActionView::Template::Error (can't modify frozen Hash):
    1: <%= render_crumbs :last_crumb_linked => false, :format => :html_list, :ul_class => 'breadcrumb', :last_class => 'active' %>
  
app/views/layouts/_breadcrumbs.html.erb:1
app/views/articles/edit.html.erb:2

If I comment out the render_crumbs call in my template then the error goes away.

Ideas?

richardonrails avatar Apr 02 '21 21:04 richardonrails

@richardonrails

Hi, this repository has not been maintained for a long time. Please fork the repository at https://github.com/wested/crummy and try modifying lib/crummy/standard_renderer.rb:7 as follows

-    ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES.merge([:itemscope].to_set)
+    ActionView::Helpers::TagHelper::BOOLEAN_ATTRIBUTES.dup.merge([:itemscope].to_set)

rhiroe avatar May 14 '21 05:05 rhiroe

Thank you!

For anyone else who's looking for a similar breadcrumb library that's actively maintained, I found these 2: https://github.com/piotrmurach/loaf https://github.com/weppos/breadcrumbs_on_rails

richardonrails avatar May 14 '21 15:05 richardonrails