We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 new myapp -c tailwind
bin/rails g scaffold Admin::Books name:string
bin/rails db:migrate
root "admin/books#index"
bin/dev
undefined method `edit_book_path' for an instance of #<Class:0x000000012316db80>
We should have the edit links working for the book.
Inside the file app/views/admin/books/_book.html.erb, we should change the following:
app/views/admin/books/_book.html.erb
<%= link_to "Edit this book", edit_book_path(book), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
to
<%= link_to "Edit this book", edit_admin_book_path(book), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
or maybe it's related to the module definition in: app/models/admin.rb
app/models/admin.rb
Rails version: 7.1.3.2
Ruby version: ruby 3.3.1 (2024-04-23 revision c56cd86388) +YJIT [arm64-darwin23]
The text was updated successfully, but these errors were encountered:
@brunto Can you please re-open this issue on https://github.com/rails/tailwindcss-rails? Thank you!
Worth noting, some work is already being done to clean up the templates: rails/tailwindcss-rails#357
Sorry, something went wrong.
See also rails/tailwindcss-rails#359 which I think fixes this issue.
No branches or pull requests
Steps to reproduce
rails new myapp -c tailwind
bin/rails g scaffold Admin::Books name:string
bin/rails db:migrate
root "admin/books#index"
bin/dev
(don't forget to install foreman)undefined method `edit_book_path' for an instance of #<Class:0x000000012316db80>
Expected behavior
We should have the edit links working for the book.
Actual behavior
undefined method `edit_book_path' for an instance of #<Class:0x000000012316db80>
Fix
Inside the file
app/views/admin/books/_book.html.erb
, we should change the following:to
or maybe it's related to the module definition in:
app/models/admin.rb
System configuration
Rails version: 7.1.3.2
Ruby version: ruby 3.3.1 (2024-04-23 revision c56cd86388) +YJIT [arm64-darwin23]
The text was updated successfully, but these errors were encountered: