Question: I have a library written in VB.NET containing extension methods. VB.NET has two characteristics that in my opinion are at odds with the concept of extension methods:

* Extension methods must be declared in a module ([Extension Methods](http://msdn.microsoft.com/en-us/library/bb384936.aspx))
* All module members are at the namespace scope ([Type Promotion](http://msdn.microsoft.com/en-us/library/xz7s1h1x.aspx))

This means that extension methods are always either accessible at the namespace level, or not accessible at all. This doesn't make sense, because their scope is conceptually the type they extend, *not* the namespace.

The fact that a method is declared as an extension influences its naming, because while a global utility method might include the type, like `GetDictionaryValueOrNull`, an extension method can simply be `GetValueOrNull` because it should already be clear that it is declared for the `Dictionary` type. When extension methods are global, this can be confusing: Say we are in a (non-Dictionary) class which has a `GetValue` method. If we type "GetValue", Visual Studio will list both "GetValue" and "GetValueOrNull", making it appear as though the current class supports both operations.

Is there any solution to this (other than "write it in C#")? Can I mark a module as non-global, or at least force Visual Studio to only display extension methods *when* they are actually being looked up as extension methods?

Suggestion at Visual Studio User Voice: <http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/4228049-include-an-option-to-disable-the-promotion-of-scop>

Answer: 
SOLVED!

**LandingPageController**

```
class LandingPageController < ApplicationController
  skip_before_action :authenticate_user!

  def index
  end

end

```

**HomeController**

```
class HomeController < ApplicationController
  skip_before_action :authenticate_user!
  before_action :check_auth

def check_auth
    unless user_signed_in?
        redirect_to :controller => :landing_page
    end
end
 end 

```

**ApplicationController**

```
class ApplicationController < ActionController::Base

  before_action :authenticate_user!

end

```

**Routes.rb**

```
 root 'landing_page#index'

```
I think you can write confirm\_logged\_in function action in controller  

before\_filter :confirm\_logged\_in

In that function you can mention how you want to render pages based on logged in user  

```
def confirm_logged_in<br>
  unless session[:user_id]
  flash[:notice] = 'Please log in.'
  redirect_to(:controller => 'access', :action => 'login')
  return false #halts the before_filter<

else
return true
  end
end

```