routes.rb
-----------
resources :mail_settings
My form looks like this
the _form.html.erb
---------
<%= form_tag '/mail_settings' do %>
<div class="fieldBlock">
<%= label_tag :name %> <%= text_field_tag :name%> </div>
<div class="fieldBlock">
<%= label_tag :id%> <%= text_field_tag :id%> </div>
<div class="actions fieldBlock">
<%= submit_tag "Update Settings ", :class => "btn-large btn-success" %>
</div>
<% end %>
but I can access individual params like params[:name] without any problem, why is it not working when i try params[:mail_setting] ?
you mean why it is
params[:name]and notparams[:mail_setting][:name]? If so, the reason is that you are usingform_taginstead of just aform, and family of *_tag helpers [ i.e. text_field_tag ]. In that case you do not ‘bind’ form to the model – in general form_tag is much more flexible than form. However, You should be able to do something likeand you will get params[:mail_setting][:name]
Hope I guessed what you asked about!