In my view I've a form where I only want to show inputs when its parameters appear in the URL:

```
= form_tag search_path, :method => :get do
  = select_tag 'search[type]', options_for_select([['Publishers', 'publishers'], ['Editions', 'editions'], ['Contributors', 'contributors']], selected = (params[:search][:type] rescue nil)), prompt: "Search type", :required => "true"

  = select_tag 'search[filter]', options_for_select([['Filter by', 'filter_by'], ['All', 'all']], selected = (params[:search][:filter] rescue nil)), prompt: "Select filter", :required => "true"

  - invisible = params[:search][:value].present? ? '' : 'invisible'
  = text_field_tag 'search[value]', (params[:id] || params[:search][:value] rescue nil), :required => "true", :class =>  "#{invisible}", :placeholder => "Type search"

```

My idea was control it showing a CSS class called "invisible" with `display: none;`, as above. But when I render the view it returns this Rails error in the line where I declare the "invisible":

```
undefined method `[]' for nil:NilClass

```

What's wrong?