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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:27:51+00:00 2026-06-11T04:27:51+00:00

I need to send on my Devise registration form params of the actual language

  • 0

I need to send on my Devise registration form params of the actual language that the user selected and that I keep in the route as params[:lang].

I have a custom controller because I am validating a reCaptcha(that part works).

So I have in my routes:

    devise_for :users, controllers: { registrations: 'registrations' }

    devise_for :users do
         root :to => "devise/registrations#new"
         get "/" => "devise/registrations#new"
         post '/' => 'registrations#new', :as => :new_user_registration 
         match '/', :to => 'devise/registrations#new'
         get "/logout", :to => "devise/sessions#destroy", :as => "logout"
    end

    #Sign
    match '/:lang/:sec/sign' => 'frontend#sign', :as => :sign

In my register form:

   <%= form_for(resource, :as => resource_name, :url => 
   registration_path(resource_name, :lang => params[:lang], :sec => params[:sec])) 
   do |f| %>

And i have two controllers, one for users and another for administrators, on successful login, Devise goes to the users controller, callers Restringido and wonders whether the user is validates as admin or only a common user.

In my restringido controller:

    class RestringidoController < ApplicationController

    before_filter :verify_is_user

    def verify_is_user
       if current_user.try(:admin?)
       #redireccionar a backend
       redirect_to :controller => "backend", :action => "index"
    elsif current_user
       #mantenerte en este controlador
    else
       redirect_to :controller => "frontend", :action => "sign"
    end

And my backend controller for administrators:

    before_filter :verify_is_admin

    def verify_is_admin
       if current_user.admin?
    else
       redirect_to root_path
    end

And the error is:

    No route matches {:controller=>"frontend", :action=>"sign"}
  • 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-11T04:27:53+00:00Added an answer on June 11, 2026 at 4:27 am

    Your route:

    match '/:lang/:sec/sign' => 'frontend#sign', :as => :sign
    

    requires the :lang variable to be set, and you have not provided a default value. So this call in the controller:

    redirect_to :controller => "frontend", :action => "sign"
    

    will fail to match the route, because you have not provided a :lang variable

    To fix this, you can either provide the :lang value in the controller eg:

    redirect_to :controller => "frontend", :action => "sign", :lang => (params[:lang] || DEFAULT_LANG)
    

    or have a default value in the route.

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

Sidebar

Related Questions

I've a custom form (created with form API) that need send an uploaded file
I currently have a simple app that includes user authentication through devise and a
I need send certain attributes(say, human readable user name) from server to client after
So I need to send a confirmation email every time a user signs up.
I have been assigned a project in which I need to send commands to
Im trying to override devise in order to send mail to activate a user.
I have devise for authentication and i have not used validatable and i send
I have a need to send bytes through the serial port and wanted to
We have used Devise + OmniAuth as authentication mechanism to authenticate user with facebook,
I need to send data to a hardware device over serial port. I'm 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.