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
Rails 5 compatibility #43
Comments
Hi, Your guess is correct. discussion: rails/rails#18337 |
Based on this comment in the discussion mentioned above, you can get around this easily.
After running # lib/templates/erb/scaffold/index.html.erb : 22ish
<tbody>
<%% @<%= plural_table_name%>.each do |<%= singular_table_name %>| %>
<%%= content_tag :tr, id: dom_id(<%= singular_table_name %>), class: dom_class(<%= singular_table_name %>) do %>
<% attributes.each do |attribute| -%>
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
<% end -%>
<td><%%= link_to 'Show', <%= singular_table_name %> %></td>
<td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>) %></td>
<td><%%= link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' } %></td>
<%% end %>
<%% end %>
</tbody> This removes the need to require a gem just to use I've submitted a PR, but this project hasn't moved in quite some time, so I'm not sure if it will get accepted. I've also only tested against my current Rails 5.1 project. Hopefully you find this useful! |
Brand new rails 5.0.0 app, add the following to Gemfile:
Bundle, and
rails generate bootstrap:install -f
.Generate a scaffold:
rails g scaffold car make:string model:string year:integer price:decimal
Start up rails server, visit http://localhost:3000/cars.
Error:
Adding the record_tag_helper line fixes the issue.
Maybe bootstrap-generators should add a runtime_dependency on record_tag_helper?
The text was updated successfully, but these errors were encountered: