Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

single checkbox #6

Closed
brutuscat opened this issue Dec 13, 2011 · 10 comments
Closed

single checkbox #6

brutuscat opened this issue Dec 13, 2011 · 10 comments

Comments

@brutuscat
Copy link
Contributor

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?

@rafaelfranca
Copy link
Collaborator

Could you please provide a screenshot?

@brutuscat
Copy link
Contributor Author

sure, here it is http://imgur.com/2vS9B

By the way I'm using Chrome. Note the checkbox it's not base aligned and it seems to float at the top of the row.
There is also a tiny issue with the checkbox control itself: The top part of if seems hidden or something, removing the input, textarea {
-webkit-transform-style: preserve-3d;} style seems to fix it, but I guess it may be an issue of Bootstrap...

@rafaelfranca
Copy link
Collaborator

Could you provide the generated markup. I think that your application is generating the wrong markup

@brutuscat
Copy link
Contributor Author

The markup of my main content div:

<div id="container" class="container">
      <div id="main" role="main">
        <h2>Sign in</h2>

<form accept-charset="UTF-8" action="/users/sign_in" class="simple_form new_user" id="user_new" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" /><input name="authenticity_token" type="hidden" value="RNuHDwpiF/HHUCHc7JHgkY2CHFc1UIZOa9QtGUGFrRU=" /></div>
  <div class="clearfix email optional"><label class="email optional  " for="user_email">Email </label><div class="input"><input class="string email optional " id="user_email" name="user[email]" size="50" type="text" value="" /><span class="help-block">Your E-mail address</span></div></div>
  <div class="clearfix password optional"><label class="password optional  " for="user_password">Password </label><div class="input"><input class="password optional " id="user_password" name="user[password]" size="50" type="password" /></div></div>
  <div class="clearfix boolean optional"><label class="boolean optional  " for="user_remember_me">Remember me </label><div class="input"><input name="user[remember_me]" type="hidden" value="0" /><input class="boolean optional " id="user_remember_me" name="user[remember_me]" type="checkbox" value="1" /></div></div>

  <input class="btn primary" name="commit" type="submit" value="Sign in" />
</form>


  <a href="/users/sign_up">Sign up</a><br />

  <a href="/users/password/new">Forgot your password?</a><br />




      </div>

      <footer>
      </footer>
    </div> <!--! end of #container -->

@rafaelfranca
Copy link
Collaborator

The generated markup was wrong and we need to fix at SimpleForm. Cloud you open a pull request for this application adding an example of bollean check boxes? I'll try to fix it at SimpleForm

@brutuscat
Copy link
Contributor Author

Done #7

;)

rafaelfranca added a commit that referenced this issue Dec 14, 2011
Add checkbox example Issue #6
@rafaelfranca
Copy link
Collaborator

Thanks. I'll take a look on this

@lucasmazza
Copy link
Contributor

Same as #2, I'm closing this and the markup problem will be handled on simple_form. See #414.

@andr3w321
Copy link

Any chance someone could help me out with some formatting issues? http://stackoverflow.com/questions/12155228/twitter-bootstrap-rails-simple-form-formatting

@carlosantoniodasilva
Copy link
Member

@andr3w321 seems like it's already solved through stack overflow. Please feel free to use the mailing list if you have any other problems. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants