Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8144539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:24:54+00:00 2026-06-06T13:24:54+00:00

I currently am using Rails’ Devise plugin to handle login/authentication. I am using a

  • 0

I currently am using Rails’ “Devise” plugin to handle login/authentication. I am using a very basic form_for tag to handle the log-in form. Here is the code:

<div class="well-outer splash-signin-block">
  <div class="well-inner">
    <h2>Sign in</h2>
    <div>
      <%= form_for(resource, as: resource_name, url: user_session_path, html: {
        class: "form-inline"
      }) do |f| %>
        <p><%= f.text_field :email, placeholder: "Email", autofocus: true %></p>
        <p><%= f.password_field :password, placeholder: "Password" %></p>
        <p>
          <%= f.submit 'Sign in', class:"btn btn-primary btn-large" %>
          <%= f.check_box :remember_me, class: "checkbox" %>
          <%= f.label :remember_me %>
        </p>
      <% end %>
    </div>
  </div>
</div>

However, I would like to change that “Remember me” checkbox in to a button. The user experience would be that they could either click “Sign in” (the default action) or they could click “Remember me” to sign in persistently.

Behind the scenes, I imagine this would work by using a hidden field that sets the resource[remember_me] property to “1”. However as a rails newbie I don’t know how to go about coding this. I imagine it will need some javascript and that is fine, but googling has only turned up AJAX-y stuff and I don’t think that’s necessary. I won’t shy away from it if it is necessary, though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:24:56+00:00Added an answer on June 6, 2026 at 1:24 pm

    You would create a button with some id, then use javascript to bind to the click event of that button. When the button is clicked, you want to change the value of a hidden field. If you were using jQuery, it would be something like…

       $('#id_of_button').click(function() {
         $('#id_of_hidden_field').val("true");
       });
    

    Then you just check for that value in the controller like you normally would.

    If you’re not using jQuery it’s not much more work, I just don’t know it off the top of my head. Btw this code should be located in a .js file in your assets/javascript folder

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails 3 app that is currently using Devise for authentication. I
I'm currently using RESTful Authentication plug-in on my rails application. There is a typical
I'm currently trying to get a Mongo database running alongside Devise. I'm using Rails
I am currently using Devise+Omniauth on my Rails 3 app to authenticate users. My
I'm currently using the awesome attachment-fu plugin for a Rails app, but as a
I am currently using ambethia's recaptcha plugin for rails. I want to disable the
i'm currently buidling my own blog using rails 3. and use devise gem for
I am currently using two forms in my rails app, one for a contact
Currently I am working on project like web analytic using rails 3.2.3 I have
im working in a project writen in ruby on rails and im currently using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.