ruby on rails - using existing inputs to create form for user to sign in -


using user model, created devise, , simple form gem want give user ability log in main page. have inputs, created in haml, , want use them this:

.login-wrapper         .user-fields           %input{type: "text", placeholder: "username", class: "ribbon-placeholder mail"}           .slide             %input{type: "password", placeholder: "password", class: "ribbon-placeholder password"}             = link_to "#", class: "ribbon-button"               %span register               .account-arrow           .clearfix          %input{type: "submit", value: "log in", class: "ribbon-button orange-background log-in"} 

ok can use form this. reference not form yours:-

<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) |f| %>   <div><%= f.label :email %>   <%= f.email_field :email, :autofocus => true %></div>    <div><%= f.label :password %>   <%= f.password_field :password %></div>    <% if devise_mapping.rememberable? -%>     <div>         <label class="checkbox" for="merchant_remember_me">             <%= f.check_box :remember_me %> remember me         </label>     </div>   <% end -%> <br />   <div><%= f.submit "sign in" %></div> <% end %> 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -