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 7836143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:59:21+00:00 2026-06-02T13:59:21+00:00

I have having a problem logging into my existing app with custom authorization. When

  • 0

I have having a problem logging into my existing app with custom authorization. When I login, I get the error

No route matches {:action=>"show", :controller=>"users", :locale=>#<User id: 4, first_name: "asd", last_name: "asd", email: "c@c.com", password_digest: "$2a$10$FDkc/CkjbwS455r/s.OF9uXUzuRmzz3zsYEejij.0KCT...", access_level: 3, last_login

Here is my routes file

Islasdelsol::Application.routes.draw do
  scope ":locale", locale: /#{I18n.available_locales.join("|")}/ do
    root :to => 'sites#index'
    get "logout" => "sessions#destroy", :as => "logout"
    get "login" => "sessions#new", as: "login"

    resources :sites, except: [:new, :show, :destroy, :create] do
      collection do
      get :about_us
      get :contact_us
      get :news
      get :reservations
      get :sell
      get :tour
    end
  end

resources :users do
  collection do
    get :monthly_letter
    get :admin
    get :regime
    get :general_assembly
    get :monthly_record
    get :newowner
    get :financial_report
    get :email_owners
  end
end

resources :email_owners do
  collection do
    get :email
    get :islas
    post :email
    post :islas
  end
end

resources :regimes do
  collection do
    get :spanish
    get :english
  end
end

resources :general_assemblies do
  collection do
    get :spanish
    get :english
  end
end
resources :sessions
resources :monthly_letters
resources :monthly_records


resources :financial_reports do
  collection do
    get :monthly
    get :yearly
  end
  end
  match "*path", to: "sites#not_found" # handles /en/fake/path/whatever
end
root to: redirect("/#{I18n.default_locale}") # handles /
match '*path', to: redirect("/#{I18n.default_locale}/%{path}")
end

Here is my sessions controller and form, where the call is originating from

class SessionsController < ApplicationController
  def create
  user = User.find_by_email(params[:email])
  if user && user.authenticate(params[:password])
    session[:user_id] = user.id
    redirect_to user, :notice => "Logged in!"
  else
    flash.now.alert = "Invalid email or password"
    render "new"
  end
end

Form

<%= form_tag sessions_path do %>
<table>
    <tr>
        <td><label for="email">Email</label></td>
    </tr>
    <tr>
        <td><%= text_field_tag :email, params[:email] %> </td>
    </tr>
    <tr>
        <td>Password</td>
    </tr>
    <tr>
        <td><label for="password"><%= password_field_tag :password %>   </label></td>
    </tr>
    <tr> 
        <td><%= submit_tag "Log in" %> </td>
    </tr>
</table>
<% end %>

def destroy
  session[:user_id] = nil
  redirect_to root_url, :notice => "Logged out!"
end

end

And my rake routes controller=users

monthly_letter_users GET    /:locale/users/monthly_letter(.:format)   {:locale=>/en|es/, :action=>"monthly_letter", :controller=>"users"}
admin_users GET    /:locale/users/admin(.:format)            {:locale=>/en|es/, :action=>"admin", :controller=>"users"}
regime_users GET    /:locale/users/regime(.:format)           {:locale=>/en|es/, :action=>"regime", :controller=>"users"}
general_assembly_users GET    /:locale/users/general_assembly(.:format) {:locale=>/en|es/, :action=>"general_assembly", :controller=>"users"}
monthly_record_users GET    /:locale/users/monthly_record(.:format)   {:locale=>/en|es/, :action=>"monthly_record", :controller=>"users"}
newowner_users GET    /:locale/users/newowner(.:format)         {:locale=>/en|es/, :action=>"newowner", :controller=>"users"}
financial_report_users GET    /:locale/users/financial_report(.:format) {:locale=>/en|es/, :action=>"financial_report", :controller=>"users"}
email_owners_users GET    /:locale/users/email_owners(.:format)     {:locale=>/en|es/, :action=>"email_owners", :controller=>"users"}
users GET    /:locale/users(.:format)                  {:locale=>/en|es/, :action=>"index", :controller=>"users"}
POST   /:locale/users(.:format)                  {:locale=>/en|es/, :action=>"create", :controller=>"users"}
new_user GET    /:locale/users/new(.:format)              {:locale=>/en|es/, :action=>"new", :controller=>"users"}
edit_user GET    /:locale/users/:id/edit(.:format)         {:locale=>/en|es/, :action=>"edit", :controller=>"users"}
user GET    /:locale/users/:id(.:format)              {:locale=>/en|es/, :action=>"show", :controller=>"users"}
PUT    /:locale/users/:id(.:format)              {:locale=>/en|es/, :action=>"update", :controller=>"users"}
DELETE /:locale/users/:id(.:format)              {:locale=>/en|es/, :action=>"destroy", :controller=>"users"}

So, can anyone see where the problem is? There appears to be a route to users show page…

Edit: Users controller

class UsersController < ApplicationController
  helper_method :sort_column, :sort_direction
  def index
    @owners = User.owners.search(params[:search]).order(sort_column + " " +      sort_direction).page(params[:page]).per_page(5)

  end

  def new
    @user = User.new
  end


  def show
    @user = User.find(params[:id])
    @monthly_letters = MonthlyLetter.recent
  end 

   def create
 @user = User.new(params[:user])
    if @user.save
      flash[:notice] = 'User Created!'
      redirect_to @user
    else
      flash[:alert] = "User has not been created."
     render "index"
   end 
  end

  def destroy
    @user = User.find(params[:id])
    @user.destroy
    flash[:notice] = "User has been deleted."
    redirect_to current_user
  end

  def update
    @user = User.find(params[:id])

    if @user.update_attributes(params[:user])
      flash[:notice] = "User has been updated."
      redirect_to @user
    else 
      flash[:alert] = "User has not been updated."
      render :action => "edit"
    end
  end

  def monthly_letter
    @monthly_letter = MonthlyLetter.new
  end 
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-06-02T13:59:25+00:00Added an answer on June 2, 2026 at 1:59 pm

    The problem here is that url_for doesn’t know how to deal with the :locale parameter.

    You can tell what is happening in the error because it says :locale parameter is an object #<User>.
    It should be a string like the other parameters.
    That generally means that your link_to/url_for is called with incorrect or incomplete parameters.

    The first step to solving this is probably to set a default for the :locale parameter
    in your application controller. Rails Guide’s i18n document provides guidance for that
    as well as more complete solutions of looking at HTTP headers and parameters.

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

Sidebar

Related Questions

I am having problem with overriding Form Action URL I have a class to
I'm having a problem with a user logging in: 1) click facebook login button
I'm having a strange problem with my app - A have a Fragment Activity
I have been having the following problem, i think it's probably due to the
I have a flash file menu i am having problem while link it to
I'm having problem about web service method with auto increment ID. I have a
I'm having problem when running my Windows Forms program. In the program, I have
I have an old C++ project and I'm having problem building it. For a
I'm not a MySQL expert and am having problem with this... So, I have
Good day everyone. I have been having the same problem all day at work

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.