title: getting text field value from view page into controllers page
body: <p>I have a text field "tf_Designation" in a view page, see below:    </p>
  
  <pre><code>&lt;% form_for(:search) do |f| %&gt;
      &lt;table&gt; 
            &lt;tr&gt;
               &lt;td align="center"&gt;
                  &lt;%= f.text_field :tf_Designation,placeholder: "Designation" %&gt;
               &lt;/td&gt;
            &lt;/tr&gt;
      &lt;/table&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I want to get text field value into a controllers page and I am doing like below:</p>
  
  <pre><code>def search
      @blah=params[:search][:tf_Designation]
      if !params[:search][:tf_Designation].blank?
         @Designation = params[:search][:tf_Designation]
         render '/index'
      end
    end
  </code></pre>
  
  <p><code>And I do not have search model.</code> But it gave me error at this line <code>@blah=params[:search][:tf_Designation]</code>. The error is below:</p>
  
  <pre><code>undefined method `[]' for nil:NilClass
  </code></pre>
  
  <p>Kindly suggest me where I make mistake, waiting for your reply. Thanks</p>