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

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -