Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sethvargo/bootstrap_forms
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: sshaw/padrino_bootstrap_forms
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Jun 25, 2012

  1. port to Padrino

    sshaw committed Jun 25, 2012
    Copy the full SHA
    69aa562 View commit details
  2. readme/gemspec changes

    sshaw committed Jun 25, 2012
    Copy the full SHA
    92b73e3 View commit details
  3. put back README section

    sshaw committed Jun 25, 2012
    Copy the full SHA
    1d05d43 View commit details

Commits on Jun 27, 2012

  1. Copy the full SHA
    0b19b05 View commit details

Commits on Aug 27, 2012

  1. Copy the full SHA
    14285ef View commit details

Commits on Sep 8, 2012

  1. add changes from sethvargo/bootstrap_forms #49, gemfile tweeks and tr…

    …avis-ci links
    sshaw committed Sep 8, 2012
    Copy the full SHA
    f7f97bb View commit details

Commits on Sep 9, 2012

  1. Copy the full SHA
    83f8404 View commit details

Commits on Sep 10, 2012

  1. Copy the full SHA
    3883017 View commit details
  2. clarify error_messages in README

    sshaw committed Sep 10, 2012
    Copy the full SHA
    3c678a6 View commit details

Commits on Sep 17, 2012

  1. fix input_div

    k2052 committed Sep 17, 2012
    Copy the full SHA
    014848b View commit details

Commits on Sep 20, 2012

  1. Copy the full SHA
    cf0d018 View commit details
  2. add padrino check box

    k2052 committed Sep 20, 2012
    Copy the full SHA
    713c8ef View commit details
  3. add padrino check box

    k2052 committed Sep 20, 2012
    Copy the full SHA
    b3b9582 View commit details
  4. add padrino check box

    k2052 committed Sep 20, 2012
    Copy the full SHA
    4afa55b View commit details
  5. add padrino check box

    k2052 committed Sep 20, 2012
    Copy the full SHA
    f87c442 View commit details

Commits on Sep 21, 2012

  1. fix action buttons

    k2052 committed Sep 21, 2012
    Copy the full SHA
    8075a55 View commit details

Commits on Oct 14, 2012

  1. Copy the full SHA
    fc5eb61 View commit details

Commits on Oct 15, 2012

  1. v0.0.1 prep

    sshaw committed Oct 15, 2012
    Copy the full SHA
    94f4c4d View commit details

Commits on Oct 24, 2012

  1. misc commits

    k2052 committed Oct 24, 2012
    Copy the full SHA
    f7a12c3 View commit details
  2. fix typo

    k2052 committed Oct 24, 2012
    Copy the full SHA
    1a98860 View commit details

Commits on Jun 2, 2013

  1. Copy the full SHA
    14979b3 View commit details
  2. Copy the full SHA
    1644500 View commit details
  3. Copy the full SHA
    672f7d7 View commit details
  4. Copy the full SHA
    5071782 View commit details
  5. Copy the full SHA
    d5536f7 View commit details
  6. Copy the full SHA
    be17838 View commit details

Commits on Jun 4, 2013

  1. fix padrino-helpers dependency

    sshaw committed Jun 4, 2013
    Copy the full SHA
    0907d79 View commit details
  2. make sure to capture html in control_group_div

    (cherry picked from commit cf0d018)
    k2052 authored and sshaw committed Jun 4, 2013
    Copy the full SHA
    9e5b644 View commit details
  3. fix input_div

    (cherry picked from commit 014848b)
    k2052 authored and sshaw committed Jun 4, 2013
    Copy the full SHA
    110e6c3 View commit details
  4. Copy the full SHA
    dcdd471 View commit details

Commits on Jun 9, 2013

  1. Merge branch 'template_fixes' of github.com:sshaw/padrino_bootstrap_f…

    …orms into template_fixes
    sshaw committed Jun 9, 2013
    Copy the full SHA
    3138fc5 View commit details

Commits on Jun 14, 2013

  1. new test case structure

    sshaw committed Jun 14, 2013
    Copy the full SHA
    23b00f3 View commit details
  2. remove padrino_check_box alias

    sshaw committed Jun 14, 2013
    Copy the full SHA
    ccfc7c2 View commit details

Commits on Jun 15, 2013

  1. more tests, change test setup

    sshaw committed Jun 15, 2013
    Copy the full SHA
    4535201 View commit details
  2. remove have_field matcher

    sshaw committed Jun 15, 2013
    Copy the full SHA
    e3e9eba View commit details
  3. forgot to add some spec files

    sshaw committed Jun 15, 2013
    Copy the full SHA
    19360d8 View commit details
  4. Copy the full SHA
    72c974b View commit details
  5. add some HAML tests

    sshaw committed Jun 15, 2013
    Copy the full SHA
    963fe93 View commit details

Commits on Jun 16, 2013

  1. Copy the full SHA
    f4320b9 View commit details

Commits on Jun 22, 2013

  1. Copy the full SHA
    04f690f View commit details

Commits on Jun 25, 2013

  1. Copy the full SHA
    c8e7273 View commit details
  2. Copy the full SHA
    ab92be1 View commit details

Commits on Jun 26, 2013

  1. fix most failing specs

    sshaw committed Jun 26, 2013
    Copy the full SHA
    aae5fce View commit details

Commits on Jul 6, 2013

  1. Copy the full SHA
    997fdf3 View commit details
  2. Copy the full SHA
    22be768 View commit details
  3. Copy the full SHA
    bf832b5 View commit details

Commits on Jul 7, 2013

  1. Copy the full SHA
    3a3bfa4 View commit details
  2. Fix string concatenations.

    scaryzet committed Jul 7, 2013
    Copy the full SHA
    1d3f191 View commit details
  3. Copy the full SHA
    ad8b3cb View commit details
  4. Merge branch 'fixes_for_slim' into padrino-0.11

    Conflicts:
    	lib/bootstrap_forms/form_builder.rb
    	lib/bootstrap_forms/helpers/form_tag_helper.rb
    scaryzet committed Jul 7, 2013
    Copy the full SHA
    47acb27 View commit details
Showing 914 changed files with 1,595 additions and 1,063 deletions.
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 1.9.3
- 2.0
- 2.1
- 2.2
- 2.3.0

before_install:
- gem update bundler

notifications:
email: false

gemfile:
- gemfiles/padrino-0.11
- gemfiles/padrino-0.12
- gemfiles/padrino-0.13
23 changes: 23 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
v0.1.2 2016-05-13
--------------------
Bug Fixes:
* Fix minimum Padrino version depedency in gemspec

v0.1.1 2016-05-10
--------------------
Changes:
* Support for Padrino >= 0.12.6 and >= 0.13.2 (thanks Igor Bochkario)

v0.1.0 2013-07-20
--------------------
Changes:
* Only support Padrino >= 0.11

v0.0.2 2013-07-14
--------------------
Bug Fixes:
* Fix conflict between Wrappers.error and Padrino's error helper (thanks Ivan Zhidkov)
* Various failures when using Slim (thanks Ivan Zhidkov)
* Various failures when using ERB (thanks Ken Erickson & Luke Antins)
* :help_inline and :help_block now use <span> and not <p>
* FormTagHelpers methods add an id attribute to the fields they create
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "http://rubygems.org"

gemspec
gemspec
7 changes: 0 additions & 7 deletions Guardfile

This file was deleted.

73 changes: 38 additions & 35 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,34 +1,50 @@
Bootstrap Forms
Padrino Bootstrap Forms
===============
[![Build Status](https://secure.travis-ci.org/sethvargo/bootstrap_forms.png?branch=master)](http://travis-ci.org/sethvargo/bootstrap_forms)

Bootstrap Forms is a nice Rails generator that makes working with [Bootstrap (by Twitter)](http://twitter.github.com/bootstrap) even easier on Rails.
[![Build Status](https://secure.travis-ci.org/sshaw/padrino_bootstrap_forms.svg?branch=master)](http://travis-ci.org/sshaw/padrino_bootstrap_forms)

Forms with Bootstrap are crowded with additional layout markup. While it's necessary, you shouldn't have to type it every time you create a form! That's why I created Bootstrap Forms.
Padrino Bootstrap Forms is a port of [Seth Vargo's Bootstrap Forms for Rails](http://github.com/sethvargo/bootstrap_forms). Thanks Seth!

Bootstrap 2.0 Compliant!
It currently renders forms using Bootstrap 2 markup.

Padrio Version
------------------------
A super special thanks to [vincenzor](https://github.com/vincenzor) for updating `bootstrap_forms` to comply with the new methods and features in Twitter Bootstrap 2.0.
If your Padrino version is < 0.11 you must use version 0.0.2 of this gem.

To get these new features, ensure you are using `bootstrap_forms ~> 2.0.0`.

Note/Caution/Warning
--------------------
There were **major** changes in the release of version `0.1.0`:
Differences Between This & The Rails Version
------------------------

* No `bootstrap` namespace for localization
* `@builder.error_messages` was removed and the Padrino version is not automatically called when there's an error
* Models with required attributes will not have the HTML5 `required` attribute automatically added to their `input`s
* The following helpers have been removed, as they are not available in Padrino
* `collection_select`
* `country_select`
* `time_zone_select`
* `range_field`
* Various other additions made to `bootstrap_forms` after `v3`

1. The gem name has officially changed from `bootstrap-forms` to `bootstrap_forms` to match gem naming conventions. The old gem still exists on rubygems for legacy applications, however, you should update to the new gem as quickly as possible. It's faster and more stable. The old gem is no longer maintained.
2. `form_for` is no longer overridden by default. There were multiple users who were concerned that this behavior was ill advised. Instead, a new form helper, `bootstrap_form_for` has been created. This is in line with other form building libraries.
3. The gem is now a Rails 3 Engine. As such, **Bootstrap Forms will not work in < Rails 3.0**. The engine is automatically mounted when including the gem in your `Gemfile`.
Bootstrap 2.0 Compliant!
------------------------
A super special thanks to [vincenzor](https://github.com/vincenzor) for updating `bootstrap_forms` to comply with the new methods and features in Twitter Bootstrap 2.0.

Installation
------------
Add it to your `Gemfile`:

gem 'bootstrap_forms'
gem 'padrino_bootstrap_forms', :require => 'bootstrap_forms'

Don't forget to run the `bundle` command.

Register it with your application:

Don't forget to run the `bundle` command. The gem will add the method `bootstrap_form_for` for use in your project. This is different from `bootstrap_forms < 0.1.0`. In previous versions, the default form builders were overridden by default. With backlash from various community members, this is no longer the default.
class YourApplication < Padrino::Application
register BootstrapForms
# ...
end

Be sure to restart your Rails server after installing the gem.
This will add the method `bootstrap_form_for` for use in your project.

Why?
----
@@ -77,8 +93,6 @@ See description above...
= f.radio_buttons :published, { "Published" => true, "Unpublished" => false }
```

Ruby 1.8 doesn't guarantee hashes are ordered. If you care, pass in nested arrays or `ActiveSupport::OrderedHash`.

Uneditable Input
----------------
Bootstrap Forms adds another helper method that generates the necessary markup for uneditable inputs:
@@ -105,7 +119,7 @@ Bootstrap Forms also adds a default actions panel when you call `f.submit`:
```haml
= f.submit
```

generates:

```html
@@ -151,6 +165,11 @@ You can add as many options to any form helper tag. If they are interpreted by B
<td>Styles the field as success (green)</td>
<td>= f.text_field :name, :success => 'This checked out OK'</td>
</tr>
<tr>
<th>info</th>
<td>Styles the field as info (blue)</td>
<td>= f.text_field :name, :info => 'Hey, it's OK'</td>
</tr>
<tr>
<th>warning</th>
<td>Styles the field as warning (yellow)</td>
@@ -168,22 +187,6 @@ You can add as many options to any form helper tag. If they are interpreted by B
</tr>
</table>

Internationalization/Custom Errors
----------------------------------
As of `1.0.2`, `bootstrap_forms` supports I18n! More support is being added, but you can change the error header and cancel button like this:

```yaml
# config/locales/en.yml
en:
bootstrap_forms:
errors:
header: 'Your %{model} is wrong!'
buttons:
cancel: 'Forget it!'
```
Obviously you can also change to a different `lang.yml` file and use the same syntax.

Contributing
------------
I'm pretty dam active on github. Fork and submit a pull request. Most of my pull requests are merged the same day. Make sure you:
24 changes: 0 additions & 24 deletions bootstrap_forms.gemspec

This file was deleted.

6 changes: 0 additions & 6 deletions config/locales/en.yml

This file was deleted.

6 changes: 0 additions & 6 deletions config/locales/it.yml

This file was deleted.

6 changes: 0 additions & 6 deletions config/locales/sv.yml

This file was deleted.

4 changes: 4 additions & 0 deletions gemfiles/padrino-0.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "http://rubygems.org"

gemspec :path => ".."
gem "padrino", "~> 0.11.0"
4 changes: 4 additions & 0 deletions gemfiles/padrino-0.12
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "http://rubygems.org"

gemspec :path => ".."
gem "padrino", ">= 0.12.6", "< 0.13"
4 changes: 4 additions & 0 deletions gemfiles/padrino-0.13
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "http://rubygems.org"

gemspec :path => ".."
gem "padrino", "~> 0.13.2"
15 changes: 9 additions & 6 deletions lib/bootstrap_forms.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# encoding: utf-8
require 'bootstrap_forms/engine' if defined?(::Rails)
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/module/delegation'

module BootstrapForms
extend ActiveSupport::Autoload
autoload :FormBuilder, 'bootstrap_forms/form_builder'
autoload :Helpers, 'bootstrap_forms/helpers'

autoload :FormBuilder
autoload :Helpers
end
def self.registered(app)
app.helpers Helpers::FormHelper
app.helpers Helpers::FormTagHelper
end
end
17 changes: 0 additions & 17 deletions lib/bootstrap_forms/engine.rb

This file was deleted.

Loading