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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:50:45+00:00 2026-06-10T21:50:45+00:00

I am currently working on a Rails 3.2 application in which I have two

  • 0

I am currently working on a Rails 3.2 application in which I have two controllers. One is campaign and the other one is posts. Both of them are having a before_filter. Please have a look at the controller and routes below :

Campaigns Controller :

class CampaignsController < ApplicationController

  before_filter :authenticate_user!, except: [:show, :landing]

Posts Controller:

 class PostsController < ApplicationController
  before_filter :check_sign_in, :except => [:index]

Routes :

resources :campaigns do

    resources :posts
end

Before nesting the Posts Controller in Campaigns Controller the before_filter in Posts controller was working fine as I do not want the user to be logged in to just view the post. After nesting the before_filter is getting rendered even after passing the :except block in Posts controller not to check for user. Though I do want the user to be logged in for rest of the Posts action’s.

:check_sign_in is in application controller and looks like this :

protected

def check_sign_in

 redirect_to "#{sign_in_url}?origin=#{CGI::escape(request.fullpath)}" unless user_signed_in?

end

I have tried multiple things to skip the before_filter on Posts Index action but none of them seems to work. I have also tried skip_before_filter and also skip_filter but they are also not working. They simply skip before_filter on all the posts action and if I pass the except block than it implements the before_filter and do not skip it on index action.

Any help to solve this thing would be appreciated

  • 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-10T21:50:46+00:00Added an answer on June 10, 2026 at 9:50 pm

    The problem was not solved so I ended up doing it the other way !

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

Sidebar

Related Questions

Background Currently, I am working on a Rails application. I have different products that
We're working on some Ruby on Rails web application which is currently in English
I am currently working through Michael Hartl's Rails Tutorial while experimenting with some other
Hello Ruby/Rails/Merb developers! Im currently working on a web project that will have a
Hi Currently i am working on a rails project . where i have to
I am currently working on a project to internationalize one of our ruby-on-rails web
We are currently working on a Rails application hosted on Heroku. We are trying
I'm working on a Rails web application, and it's currently being used by some
I am currently working on a WCF application that consumes a Rails REST Service.
Currently I am working on one big web application and to make it 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.