Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
Added a few more options to the scaffold generator
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Nov 24, 2008
1 parent 9d3d805 commit fd10f6a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/controllers/conductor/scaffolds_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def create
def generator_arguments
returning [ "scaffold" ] do |args|
args << params[:scaffold][:name]
args << "--skip-timestamps" if params[:scaffold][:skip_timestamps] == "1"
args << "--skip-migration" if params[:scaffold][:skip_migration] == "1"
args << params[:scaffold][:fields].select { |f| f[:name].blank? }.collect { |f| "#{f[:name]}:#{f[:type]}" }
end.flatten
end
Expand Down
12 changes: 11 additions & 1 deletion app/views/conductor/scaffolds/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
<%= form.text_field :name %>
</p>

<h1>Fields</h1>

<table>
<tr>
<th>Field</th>
<th>Name</th>
<th>Type</th>
</tr>

Expand All @@ -19,6 +21,14 @@
</tr>
<% end %>
</table>


<h1>Options</h1>

<p>
<%= form.check_box :skip_timestamps %> Skip timestamps<br />
<%= form.check_box :skip_migration %> Skip migration
</p>

<p>
<%= form.submit "Create scaffold" %>
Expand Down

0 comments on commit fd10f6a

Please sign in to comment.