dry_scaffold
dry_scaffold copied to clipboard
Generating a dry_scaffold with versions 0.3.6 or 0.3.7 you get a non working scaffold!
Hi,
the generated scaffolds seem to be broken.
When generating a dry_scaffold wrong variable names are rendered in the views (using the default options).
Example: ruby script/generate dry_scaffold Book ...
In index.html.haml the collection variable is referenced as @collection where it should be @books (as defined in the corresponding controller).
In new.html.haml, edit.html.haml and show.html.haml the instance variable is referenced as @resource where it should be @book
The titles in the views are also generated wrong: "New resource" "Editing resource..." etc. instead of "New book", etc. etc.
This is not broken in the latest release from github 0.3.5.
Are you using InheritedResources?
same thing here (using inherited resources and the gem dry_scaffold-0.3.7)
Yes, i'm using InheritedResources.
From what i understand, im my example with the model Book and the action index, the variable referenced in the view should be either @books, or collection, not @collection.
From the InheritedResources doc:
In your views, you will get the following helpers:
resource #=> @project
collection #=> @projects
resource_class #=> Project
I'm seeing this bug too. Yes, using inherited resources and dry_scaffold-0.3.7 gem.
Has this been fixed? I'm getting the same errors..
I have patched it in my repo: http://github.com/albertoperdomo/dry_scaffold You can try and see if it works well for you.