Skip to content

Commit

Permalink
Documenting changes to #16
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Feb 8, 2012
1 parent a877180 commit 220382e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ generates:
</div>
```

You can skip the cancel button by passing the `:include_cancel` button a `false` value.

Pretty swell if you ask me.

Adding More Options
Expand Down
6 changes: 5 additions & 1 deletion lib/bootstrap_forms/form_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def submit(name = nil, *args)
@field_options[:class] = 'btn btn-primary'

content_tag(:div, :class => 'form-actions') do
super(name, *(args << @field_options)) + ' ' + link_to(I18n.t('bootstrap_forms.buttons.cancel'), (@field_options[:back] || :back), :class => 'btn cancel')
if @field_options[:include_cancel] == false
super(name, *(args << @field_options))
else
super(name, *(args << @field_options)) + ' ' + link_to(I18n.t('bootstrap_forms.buttons.cancel'), (@field_options[:back] || :back), :class => 'btn cancel')
end
end
end

Expand Down

0 comments on commit 220382e

Please sign in to comment.