0

Is it possible to customize or find a gem that changes the behaviors of auto generating Tables in the views when I use rails scaffold and change it with Divs instead? Like cleaner templates, I'm using rayan's nifty generators but it uses tables instead of divs .

Any help would be highly appreciate .

Eqbal

Abbas
  • 6,720
  • 4
  • 35
  • 49
Eki Eqbal
  • 5,779
  • 9
  • 47
  • 81
  • How exactly do you expected the created scaffold too look? Because, you know, tabular data is usually presented in ``s.
    – Niklas B. Jan 04 '12 at 16:29
  • ya but I thought I can find one with all divs and css, with the basic look of it that would save time instead of modifying it manually every time, specially that I'm using rails with DB driven application and it is all about scaffolding and CRUD, is there any built-in templates to do such a thing ? – Eki Eqbal Jan 04 '12 at 16:34
  • Again, what do you want the CRUD to look? You can't really make it look like a table in older browser without using a ``, so how *should* it look? A list of blocks with a list of properties in them? *EDIT*: I added an answer below with some info.
    – Niklas B. Jan 04 '12 at 16:39
  • Niklas, ya I'm looking for list of properties blocks rather than a tables – Eki Eqbal Jan 04 '12 at 16:43

1 Answers1

4

I don't know of any such scaffold generator, but you can build one easily by taking Ryan's nifty generators as a starting point. You can modify it to your needs by following these steps:

  1. Fork the repository on Github and clone it.
  2. Change the file /rails_generators/nifty_scaffold/templates/views/erb/index.html.erb to fit your needs.
  3. Commit and push your changes.
  4. Add the newly created Gem to your Gemfile like this:

gem "nifty-generators", :gem => "https://github.com/[your_user]/nifty-generators.git"
Niklas B.
  • 92,950
  • 18
  • 194
  • 224