How does namespacing work at lower levels with form_for in rails? -


my model 'posts' isn't namespaced.

my controller namespaced admin/posts_controller.rb , it's new method looks so:

class admin::postscontroller < applicationcontroller .....  def edit       @post = post.find( params[:id] )   end 

why work:

<%= form_for [:admin, @post]  |f| %> 

but not this:

<%= form_for @post  |f| %> 

how form_for mapping @posts variable?

why autofill form text-areas when namespace there?

a valid @post variable being passed view in both cases.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -