Re: uninitialized constant ApplicationController

amritpal pathak
2011-06-21T11:38:07Z

On Tue, Jun 21, 2011 at 7:21 AM, Chirag Singhal
<chirag.singhal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:

> Yes. Create a new directory "admin" under app/views and move
"posts"
> directory into that one.
> again bad luck.I did as you said.
> new error
>

ActionController::RoutingError in Admin/posts#index

Showing */home/amrit/check/app/views/admin/posts/index.html.erb* where line
*#2* raised:

No route matches {:controller=>"posts",
:action=>"new"}

I did everything as previous before namespacing ,it was working.The
file new.html.erb exist in same directory.This file looks :


<%= link_to ''New Post'', new_post_path%>
<%= form_for(@post) do |f| %>



<%= f.label :name %>
    <%= f.text_field :name %>


<%= f.label :title %>
    <%= f.text_field :title %>


<%= f.label :content %>
    <%= f.text_area :content %>





    <%= f.submit %>



<%= f.label :sign %>
    <%= f.text_field :sign %>


<%= f.label :value %>
    <%= f.text_field :value %>


<% end %>

<%= submit_tag "Test me!", :type => ''button'',
:onclick => ''alert("It
works!")'' %>

<%= submit_tag "Click me", :type => ''button''
%>
<%= button_to "Great", :action => "click"%>
 <%= button_to "click me", :action => "work"%>


        here if i removed 1st time just to test ,the next line gives the error:

No route matches {:controller=>"posts"}

               I think we are missing something to add or else.

thanks

amritpalpathakgne.wordpress.com