GithubHelp home page GithubHelp logo

heartcombo / simple_form-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
794.0 24.0 284.0 2.77 MB

Example application with SimpleForm and Twitter Bootstrap

Home Page: https://simple-form-bootstrap.herokuapp.com

License: MIT License

Ruby 53.40% JavaScript 4.05% HTML 40.29% SCSS 2.26%
simple-form bootstrap hacktoberfest

simple_form-bootstrap's Introduction

simple_form-bootstrap's People

Contributors

axelarge avatar bradly avatar brutuscat avatar carlosantoniodasilva avatar carlosgaldino avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar derencius avatar douten avatar georgeguimaraes avatar ggrocco avatar hugobarauna avatar josevalim avatar laurocaetano avatar lucasmazza avatar lukaszx0 avatar m5o avatar macarthy avatar mhw avatar nerian avatar petejkim avatar rafaelfranca avatar techmaverick avatar thorpj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple_form-bootstrap's Issues

When trying out this app I get error


ActionView::Template::Error (kramdown has no parser to handle the specified input format: GFM):
    14: 
    15:   <%# move modals to bottom %>
    16:   <%= render partial: "shared/modal", locals: { id: "modal-bootstrap", title: "Bootstrap",
    17:     content: render_source(File.read(File.join(Rails.root, 'app/views/exampleas/verticals/_bootstrap.html.erb'))) } %>
    18: 
    19:   <%= render partial: "shared/modal", locals: { id: "modal-simpleform", title: "Simple Form",
    20:     content: render_source(File.read(File.join(Rails.root, 'app/views/examples/verticals/_form.html.erb'))) } %>

Move to central organisation?

Hi!

I am the maintainer of three gems similar to this one that make it easier to use Twitter Bootstrap in Ruby projects (https://github.com/krautcomputing/rails-bootstrap-navbar, https://github.com/krautcomputing/bootstrap-navbar, https://github.com/krautcomputing/middleman-bootstrap-navbar).

I was thinking about moving all those gems to a separate organisation (like "bootstrap-ruby") and wanted to get some feedback from other maintainers of similar gems (and the community at large) if that makes sense and if we could use this to make it easier for people to find gems to work with Bootstrap in Ruby (Rails, Sinatra, etc.)
I think it would also invite other people to contribute to those projects if they were united in a central organisation.

What do you think?
Would you be willing to move this repo to such an organisation as well?

`

wrong issue. Sorry for the creation

Support Bootstrap 3

It would be great to have initial support for Bootstrap 3 as the inputs are different.

Example not working

Just to mention that your example website is not working, seems like maybe you have to restart your heroku deployment

Not compatible with { undefined method `error_class' for SimpleForm:Module }

Is the simple_form initializer provided in this project incompatible with gem 'client_side_validations' ?
I get errors saying it cannot find
method `error_class' for SimpleForm:Module

Havent digger into simple_form that much but when you do a

= simple_form_for @invite, :wrapper => :inline, :validate => true do |f|

It throws this error
Any help on this would be greatly appreciated

rake assets:precompile misses @baseLineHeight

Great implementation!

works wonders in development - but when I do a 'rake assets:precompile' - I get

variable @baseLineHeight is undefined

I go to vendor/assets/bootstrap/lib and run

lessc bootstrap.less > ../bootstrap.css

which caters for a freshly baked bootstrap.css - but how do I get that darn thing muscled into the assets?

But again - who am I to complain! This is pretty awesome implementation - thx for sharing!

Just awesome

Parabéns, , wrapper: :horizontal_form just works. F******t time saver. Thank you.

Input generated "twice"

Configuration

  • Bootstrap 3
  • jQuery 1.11
  • Rails 3.2.17
  • simple_form 2.1

What's happening?

My inputs look to be generated twice, but there is only one <input> element in the DOM. The problem is actually coming from the class form-control that make a mess.

Here is the JS bin for you to better understand the issue here, it looks exactly the same as in my application.
JS bin:
http://jsbin.com/kesemaqi/4/edit?html,output

Source code

Initializer based on your bootstrap version and merged with my application simple_form initializer.
Simple form initializer:
http://pastebin.com/pvpxUCCW

view

.container.club
  .row
    .col-md-12.col-sm-12.well
      %p= t('new_club_explanation')
      = simple_form_for @club, wrapper: :vertical_form, validate: true, url: wizard_path, method: :put, html: { role: 'form' } do |f|
        .col-md-4
          = f.input :name, validate: true, placeholder: 'Enter club name', input_html: {autofocus: 'autofocus', class: 'form-control'}
        = f.input :description, placeholder: 'Enter club description', input_html: {class: 'form-control'}

        .actions
          = f.submit class: 'btn btn-primary', value: t('next')
          - # TODO Btn should restart the frame => goto choices view.
          = button_tag t('cancel'), type: 'button', class: 'btn btn-reverse'

Tests

Okay, so now I'll explain what I already tried.
I know that the problem is coming from the form-control class.

  • If I remove the class form-control from the input, then the input is still duplicated but don't use a bootstrap style anymore. (You can try on the live JS bin)
  • If I change the wrapper => vertical_form:
b.wrapper tag: 'div' do |ba|
      ba.use :input, class: 'form-control'

to

b.wrapper tag: 'div' do |ba|
      ba.use :input

As you can see (http://jsbin.com/kesemaqi/5/edit?html,output), the view become more or less normal.

I'm wondering what's wrong, because I use your wrappers. Is it because I'm using simple_form 2.1? I would like to understand what's wrong before change the wrappers.
Thanks.

disable and enable with checkbox

Hello Guys,
I'm trying to disable and enable action with checkbox on the post form.
And I don't know much about javascript or JQuery.
And I'm trying to do this action a lot and I don't how to do it, I'm programming alone. So if anyone could help me with this. I will appreciate!
I'm using a Rails 4.2.8 and jquery-rails-4.3.1 versions.
my form: app/views/posts/_form.html.slim

= simple_form_for(@post, :html => { :multipart => true }) do |f|
   = f.input :publish,
             label: "Publish?",
             as: :boolean,
             label_html: { class: "publish-check" },
             input_html: { checked: false },
             remote: true
   = f.input :published_at, disabled: true, hint: 'You cannot publish your post.',label: "Publish Post at:"

I'm trying to put this on the file app/assets/javascript/_form.coffee it's alright or I need to put on another file?

$(document).on "turbolinks:load", ->
  $checkbox = $('[id^="post_publish"]')
  $select = $('.post_published_at')
  $checkbox.change (e) ->
    $select.prop 'disabled', !$checkbox.is(':checked')
    return
  return

This field published_at it's a date time.
So I think now I need to put some array, the id's generated it's like id="post_published_at_1i" and until id="post_published_at_5i"

check boxes and option boxes

Alright, I tried my luck with getting check boxes and option boxes support.

If you present the html necessary as haml then it would look like this:

.clearfix
  %label
  .input
    %ul.inputs-list
      %li
        %label
          %input
      %li
        %label
          %input

So the wrapper configuration would need to look like something like this:

  config.wrappers :inline, :class => 'clearfix', :error_class => :error do |b|
    b.use :placeholder
    b.use :label        # how to get the label of all options boxes?
    b.use :tag => 'div', :class => 'input' do |ba|
      # how to use conditionally this (if many field)...
      ba.use :tag => 'ul', :class => '.inputs-list' do |bc|
        bb.use :tag => 'li' do |input|
          bc.use :label do |input|
            input.use :input
          end
        end
      end
      ba.use :input # ...or this if this is single field? 
      ba.use :error, :tag => :span, :class => :'help-inline'
      ba.use :hint,  :tag => :span, :class => :'help-block'
    end
  end

My questions:

  1. How to tell b.use :label to show the label of the option group?
  2. How to conditionally use the rather complex part from above when there are option boxes or check boxes and the rather simple ba.use :input when it is a single text field?

I would really appreciate some hints and tips.

Grid wrapper class

Hi,
I'm trying to use an horizontal_form for a simple input with a label and I'm trying to change the size of the input by using bootstrap class but it doesn't work. By looking in details the code the grid_wrapper has the following class col-sm-9 and despite the fact that I try to use grid_wrapper_html to specify a bootstrap class the initial is still present.

Is there any way of replace this value with my own without creating a custom wrapper?

Thanks in advance.

undefined method `boolean_label_class

$ rails g scaffold post

/home/user/demo/config/initializers/simple_form.rb:153:in block in <top (required)>': undefined methodboolean_label_class=' for SimpleForm:Module (NoMethodError)
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/simple_form-3.0.2/lib/simple_form.rb:216:in setup' from /home/user/demo/config/initializers/simple_form.rb:2:in<top (required)>'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in load' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:inblock in load'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in load_dependency' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:inload'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/engine.rb:648:in block in load_config_initializer' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/activesupport-4.1.0/lib/active_support/notifications.rb:161:ininstrument'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/engine.rb:647:in load_config_initializer' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/engine.rb:612:inblock (2 levels) in class:Engine'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/engine.rb:611:in each' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/engine.rb:611:inblock in class:Engine'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/initializable.rb:30:in instance_exec' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/initializable.rb:30:inrun'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/initializable.rb:55:in block in run_initializers' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:226:inblock in tsort_each'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:348:in block (2 levels) in each_strongly_connected_component' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:418:inblock (2 levels) in each_strongly_connected_component_from'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:427:in each_strongly_connected_component_from' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:417:inblock in each_strongly_connected_component_from'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/initializable.rb:44:in each' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/initializable.rb:44:intsort_each_child'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:in call' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:411:ineach_strongly_connected_component_from'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:347:in block in each_strongly_connected_component' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:ineach'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:in call' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:345:ineach_strongly_connected_component'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:224:in tsort_each' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/tsort.rb:205:intsort_each'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/initializable.rb:54:in run_initializers' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/railties-4.1.0/lib/rails/application.rb:288:ininitialize!'
from /home/user/demo/config/environment.rb:5:in <top (required)>' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application.rb:92:inrequire'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application.rb:92:in preload' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application.rb:140:inserve'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application.rb:128:in block in run' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application.rb:122:inloop'
from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application.rb:122:in run' from /home/user/.rvm/gems/ruby-2.1.0@demo/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in<top (required)>'
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require' from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
from -e:1:in `

'

Running with Bootstrap 3 & 4 in the same app, insane or possible?

We have a mature app using simple_form with Bootstrap 3. We are developing a new set of features where we would like to use Bootstrap 4 or maybe even 5 depending on when we launch the features, with the goal of eventually transitioning the old v3 views to use whatever new version we settle on.

Is there any suggested way of doing this? One option I guess would be to customize all of the wrappers in the generated simple_form bootstrap initializer (e.g. add a bs4_ prefix or something like that and then explicity add wrapper: :bs4_vertical_form or whatever in each call to simple form. I would like to avoid this if possible, but not if it's the only sane way.

I guess another option would be to remove the initializers and create two separate form builders and move all the initialization configuration code into the initialize method of each form builder. That's probably not great for performance but it may not be enough of an issue to matter.

Does anyone have any other ideas or suggestions? Thanks in advance.

easier datetime select class configuration

hey folks, super excited you're putting these two great libraries together. Awesome job.

The only form element I've had some troubles with so far is a datetime select. Without any further customization the select's are far too big and awkward looking. We can of course customize the individual fields to use the 'medium' and 'small' classes to better lay out the dropdowns, but I'm not sure how you'd do that from simple_form itself.

If this makes no sense, check out this pic: https://skitch.com/jackdempsey3rd/gkn7g/untitled
the bottom is the normal generated result, the top is what it looks like once I go back and add some small classes to the elements. Any thoughts?

(should probably point out that adding

:input_html => {:class => :small}

does help, but the month select is just barely too big for this. I guess a configuration to edit the html of each resulting element would be needed to support this...perhaps that's overkill/not desired tho.

Question about the text_area generation

Hi I have a question about your example and don't know how to contact you and thus post here.
In your code :
app/views/articles/_form.html.erb
Line 85:

<%= f.input :content, :input_html => { :class => "span6" } %>

In the browser, this line will generate a TEXT AREA, while I could not found why.

Coz in Line 24:

<%= f.input :name, :input_html => { :class => "span6" },

It has same code, but it is a Input text field.

Why?? It drives me crazy......
Thanks

Test this project with Rails 9001

Hi team,

we just released Rails 9001. To help us to find regression and make the final release
an awesome release for everyone, I'm here humbly asking you to test your project with this
Release Candidate.

We are planing the final release to 2014-03-20, so it would be great if you test it before
this date.

If you find any regression please open an issue on GitHub mentioning me and with the title starting
with:

[Regression 9001]

Thanks in advance.

What are known browser_validations quirks?

The option config.browser_validations is set to false by default and 'recommended due to some quirks from different browsers.'

Is there any documentation on what browsers or what quirks to be on the lookout for that were identified as a reason to choose keeping this option as a default? I'm not looking for an exhaustive list, but any direction on the issues to look out for would be appreciated as I couldn't turn up anything in a google search or past issues.

It looks like this was originally true but changes back just shy of a decade ago related to error styling: ffac64e
and documentation was updated in 2014: cbeeb3b#diff-523378c56f55355a780b4524e2ee91f1b93de9a7fc9ae8395739e805eb187089R202

boolean when using vertical form

when using a simple boolean field :
<%= f.input :published, :as => :boolean, %>

and a form-vertical

the label is displayed ABOVE the check box .... which is not nice ...
as it should be displayed inline, i.e. after the check box

but using

f.input :published, :as => :boolean, :inline_label => true, :label => false

display it nice ..

is it the way to do it ?

Rails 7: Bootstrap gem vs ImportMaps

It seems that the Bootstrap gem is not fully compatible with Rails 7.

I see in this example app that you use both the Bootstrap gem and ImportMaps.

Can we get rid of one of them (e.g. remove the gem and use only ImportMaps)?

Or does SimpleForm require the gem?

undefined method `wrappers' for SimpleForm:Module (NoMethodError)

Hi,

Trying to start the server, I'm getting this error:

/media/Projects/Kha6wa/kha6wa/config/initializers/simple_form.rb:3:in block in <top (required)>': undefined methodwrappers' for SimpleForm:Module (NoMethodError)
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/simple_form-1.5.2/lib/simple_form.rb:143:in setup' from /media/Projects/Kha6wa/kha6wa/config/initializers/simple_form.rb:2:in<top (required)>'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:in load' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:inblock in load'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in block in load_dependency' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:innew_constants_in'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:in load_dependency' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:234:inload'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:556:in block (2 levels) in <class:Engine>' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:555:ineach'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/engine.rb:555:in block in <class:Engine>' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:ininstance_exec'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:30:in run' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:55:inblock in run_initializers'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:in each' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/initializable.rb:54:inrun_initializers'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/application.rb:96:in initialize!' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from /media/Projects/Kha6wa/kha6wa/config/environment.rb:7:in <top (required)>' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:inrequire'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in block in require' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:inblock in load_dependency'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:640:in new_constants_in' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:223:inload_dependency'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in require' from /media/Projects/Kha6wa/kha6wa/config.ru:4:inblock in

'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/builder.rb:51:in instance_eval' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/builder.rb:51:ininitialize'
from /media/Projects/Kha6wa/kha6wa/config.ru:1:in new' from /media/Projects/Kha6wa/kha6wa/config.ru:1:in'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/builder.rb:40:in eval' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/builder.rb:40:inparse_file'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/server.rb:200:in app' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands/server.rb:46:inapp'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/server.rb:301:in wrapped_app' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/rack-1.3.4/lib/rack/server.rb:252:instart'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands/server.rb:70:in start' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:54:inblock in <top (required)>'
from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:49:in tap' from /opt/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.1/lib/rails/commands.rb:49:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in'

Upgrade to Rails 4?

You will know better than I, but I would like to know if it would be good for us to upgrade the Rails version here.

How use it?

Hi.

I thought that this project was a gem so I tried to add it in my gemfile:
gem 'simple_form-bootstrap', github: 'rafaelfranca/simple_form-bootstrap'

But it doesn't works, probably because this is actually a project and not a gem.

I know that this is not released yet, but I would like to give a try to the dev version.
I would appreciate to kown how use it, because I have no idea how to use it, yet.

Thanks.

Bootstrap 3 - append/prepend cannot get it fine...

I tried many ways , but I never get the %span and input inline, always a br between them

.row
.col-sm-3.col-md-3.col-lg-3
= f.label :email
= f.input :email, :wrapper => :bootstrap3_prepend, :label => false, :required => false do
%span.add-on %
= f.input_field :email, { :readonly => true}

.row
.col-sm-3.col-md-3.col-lg-3
= f.label :email
= f.input :email, :wrapper => :bootstrap3_append , :label => false, :required => false do
= f.input_field :email, { :readonly => true}
%span.add-on %

defined in initializer

config.wrappers :bootstrap3_prepend, tag: 'div', class: 'control-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.wrapper tag: 'div', class: 'controls' do |input|
input.wrapper tag: 'div', class: 'input-prepend' do |prepend|
prepend.use :label , class: 'addon'
prepend.use :input
end
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
end
end

config.wrappers :bootstrap3_append, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.wrapper tag: 'div', class: 'controls' do |input|
input.wrapper tag: 'div', class: 'input-append' do |append|
append.use :input
append.use :label , class: 'addon'
end
input.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
input.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
end
end

what is missing ?

single checkbox

Hi, this is great! I can't, however make it properly work with a single checkbox in devise:

<h2>Sign in</h2>

<%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name), 
    :wrapper => "inline")  do |f| %>
  <%= f.input  :email, :hint => "Your E-mail address"  %>
  <%= f.input  :password %>
  <%= f.input  :remember_me, :as => :boolean if devise_mapping.rememberable? %>

  <%= f.button :submit, "Sign in", :class => "primary" %>
<% end %>


<%= render :partial => "devise/shared/links" %>

I can see the input and the label properly aligned, but the checkbox itself seems to be floating around. Any clues?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.