Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix frozen string error when mixing template engines #2299

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

gr8bit
Copy link
Contributor

@gr8bit gr8bit commented Apr 18, 2022

What is this pull request for?

Situation:
There's already an _article.html.erb which was created when first installing alchemy.

Now, after adding elements and page layouts, calling rails g alchemy:elements --skip -e slim gives the following warning:

warning View uses unexpected template engine 'erb'.

followed by the this error:

/usr/local/rvm/gems/ruby-2.7.5/gems/alchemy_cms-6.0.0/lib/generators/alchemy/base.rb:20:in gsub!': can't modify frozen String: "app/views/alchemy/elements/_article.html.slim" (FrozenError)`

This PR fixes this.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

There's already an _article.html.erb which was created when first installing alchemy.

Now, after adding elements and page layouts, calling `rails g alchemy:elements --skip -e slim` gives the following warning:
>  warning  View uses unexpected template engine 'erb'.
followed by the this error:
`/usr/local/rvm/gems/ruby-2.7.5/gems/alchemy_cms-6.0.0/lib/generators/alchemy/base.rb:20:in `gsub!': can't modify frozen String: "app/views/alchemy/elements/_article.html.slim" (FrozenError)`

This PR fixes this.
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@tvdeyen tvdeyen merged commit f83cbd6 into AlchemyCMS:main Apr 18, 2022
@gr8bit gr8bit deleted the patch-1 branch April 18, 2022 21:24
tvdeyen added a commit that referenced this pull request Apr 26, 2022
Fix frozen string error when mixing template engines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants