Question: no need for answer unless you feel you want to contribute :)

So I feel stupid as hell I been banging my head against a wall with this for an hour... 
but for the sake of your head ill explain the problem,
I had a mark-up that looks like this

```
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MainSearch.aspx.cs" Inherits="MainSearchNewDesign" %>

```

And code behind that looks like this :

```
public partial class MainSearchNewDesign : System.Web.UI.Page

```

And still I got that damn error, the reason for that is that I forgot that if I have the a different file ( with a different name ) with the same class name the compiler still takes into account and tells you to go bang your head onto the wall... 

Man I feel really stupid now... but I hope this will help someone.

Answer: 
You can whitelist your scopes, like this:

```
@campaigns = if %w(ended active).include?(params[:scope])
               Campaign.public_send(params[:scope])
             else
               Campaign.all
             end

```
I think that it is too insecure and cryptic to leave the scope application to the user input.

I would do it as follows

```
def index
  @campaigns = Campaign.all
  if params[:scope] == 'ended'
    @campaign = @campaign.ended
  elsif params[:scope] == 'active'
    @campaign = @campaign.active
  end
end

```