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

  • Home
  • SEARCH
  • 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 7702913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:20:15+00:00 2026-05-31T23:20:15+00:00

long time reader first time user. I’m putting together my first RoR application and

  • 0

long time reader first time user.
I’m putting together my first RoR application and I’ve isolated everything my app should use down to:-

  • Sorcery
  • Omniauth
  • CanCan
  • twitter-bootstrap (converted to sass)

and Simple Forms.

Clean, clear and simple….Not.

Cannot for the life of me integrate (what would seem to be the most simplest of tasks) simple forms with a Sorcery “Login” without getting errors on the ‘remember_me’ field.

Simple forms doesn’t have a simple_form_tag (only simple_form_for) option which would work best on a login form from the sessions controller new method. Instead I have to create a @user instance in that method, but then get errors on the ‘remember_me’ field “undefined method `remember_me'”

Any help would be greatly appreciated.

I mean Greatly! Huge thanx in advance 🙂

sessions/new.html.erb

<% provide :title, "Log in" %>
<h1>Log in</h1>
<%= simple_form_for @user, :html => { :class => 'form-horizontal' } do |f| %>
  <fieldset>
    <legend>Login</legend>

    <%= f.input :email, input_html: { :maxlength => 100 } %>
    <%= f.input :password, input_html: { :maxlength => 20 } %>
    <%= f.input :remember_me, as: :boolean %>


    <div class="form-actions">
      <%= f.submit nil, :class => 'btn btn-primary' %>
      <%= link_to 'Cancel', users_path, :class => 'btn' %>
    </div>
  </fieldset>
<% end %>

    class SessionsController < ApplicationController
  def new
    @user = User.new
  end
  • 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-05-31T23:20:16+00:00Added an answer on May 31, 2026 at 11:20 pm

    The documentation says:

    form_tag(url_for_options = {}, options = {}, &block)
    Starts a form tag that points the action to an url configured with url_for_options just 
    like ActionController::Base#url_for. The method for the form defaults to POST.
    

    This indicates that form_tag is intended to send data directly to another URL, handled by a controller action. Indeed, in the RailsTutorial signin form, Michael Hartl uses the form_for function instead of form_tag.

    form_for(:session, url: sessions_path)
    

    Basically, the idea is that you’re sending data to be handled by the controller in some way, instead of writing to the database. Since we don’t have a model for user sessions, we have to use the :session symbol instead of @session and tell the form where (which URL) it should POST the data to.

    I suspect, though I’m not sure, that this should work with simple_form_for as well. Something like:

    <%= simple_form_for(:session, url: sessions_path) do |f| %>
    

    Update: I successfully changed the reference implementation of the sample app to use simple_form_for for creating new user sessions.

    That is, of course, assuming that the Sessions controller is handling your login, and that it has a method that responds to POST (probably create). That controller action is where you should be handling the Sorcery login.

    Here’s the Rails documentation for form_for, if you’re curious.

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

Sidebar

Related Questions

long time reader, first time asker... I am making a music app which uses
Howdy -- Long time reader, first time questioner. :) I could really use some
Hy everyone, Long time reader, first time poster. This sounds like it should be
Long time reader, first time poster. Any help is greatly appreciated. I have crafted
(Long time reader of SO, first time asking a q. I'm quite new to
first time poster, long time reader so be gentle with me :) See the
long time reader, first time poster. I’m coming with an issue that many of
Long time reader, first time poster. Working on a web site at http://www.howardpitch.com/ ,
Long time reader, first time poster. I'm a big noob when it comes to
First time poster, long time reader. I've been having a problem with figuring this

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.