uninitialized constant ApplicationController

Try this then

<%= button_to “Great”, click_admin_posts_path %>

undefined local variable or method `click_admin_posts_path’ for #<#Class:0xb6675348:0xb66732a0>

amritpalpathakgne.wordpress.com

Can you paste the code from your routes file here?

Can you paste the code from your routes file here?

Check::Application.routes.draw do

get “gne/clg”

get “posts/index”

#resources :posts, :module => “admin”

namespace “admin” do

resources :posts ,:collection =>{:click => :post}

end

#working right

#resources :posts do

#end

#working right

root :to => “posts#click”

root :to => “posts#work”

#get ‘posts/click’

#ActionController::Routing::Routes.draw do |map|

#map.root :controller => “posts”, :action => “click”

#end

#ActionController::Routing::Routes.draw do |map|

#map.root :controller => “posts”, :action => “work”

#end

end

Can you paste the code from your routes file here?

Check::Application.routes.draw do
# get "gne/clg"
get "posts/index"
#resources :posts, :module => "admin"
namespace "admin" do
resources :posts ,:collection =>{:click => :post}
end
#working right
#resources :posts do
#end
#working right
root :to => "posts#click"
root :to => "posts#work"

Can you explain what these two routes are doing?

Colin

These 2 routes were for “Great” and “click me” buttton before using namespacing.

should the changes be in these 2 routes for namespacing rather than as:

namespace “admin” do

resources :posts ,:collection =>{:click => :post}

end

thanks

amritpalpathakgne.wordpress.com

Sorry, I sent you the rails 2.3 way of routing.

It should have been like this:

namespace “admin” do

resources :posts do

collection do

post :click

end

end

And as Colin said, you can’t have two “root” routes for your app. Keep one of them and remove the other one.

Also, you may want to read up more on routing.

Here’s a link to official guide, which does a great job of explaining how routing works in rails 3

http://guides.rubyonrails.org/routing.html

Also, you may want to read up more on routing.
Here's a link to official guide, which does a great job of explaining how
routing works in rails 3
http://guides.rubyonrails.org/routing.html

I have lost track of how many times Aritpal Pathak has been advised to
read that. Also you might like to try getting him to post the result
of rake routes.

Colin

ROFLMAO :slight_smile:

Sorry, I sent you the rails 2.3 way of routing.
It should have been like this:

namespace “admin” do

resources :posts do

collection do

post :click

end

end

Great!!

working now.Thank you sir

And as Colin said, you can’t have two “root” routes for your app. Keep one of them and remove the other one.

ok

Also, you may want to read up more on routing.
Here’s a link to official guide, which does a great job of explaining how routing works in rails 3

http://guides.rubyonrails.org/routing.html

thats what i am following and i got this error from this tutorial.BTW thanks again…:stuck_out_tongue:

Sir this time i am your advice and reading it .i got the error while following section number 2.6 on namespacing.Thats why i posted here and now got my answer.Now will move ahead on tutorial.

Again thanks to all

amritpalpathakgne.wordpress.com

That is good. You could try and help Joanne(Yennie) with her problems
if you wished to make a contribution back to the Rails Community.

Colin

Also, you may want to read up more on routing.

Here’s a link to official guide, which does a great job of explaining

how

routing works in rails 3

http://guides.rubyonrails.org/routing.html

I have lost track of how many times Aritpal Pathak has been advised to

read that.

Sir this time i am your advice and reading it .i got the error while

following section number 2.6 on namespacing.Thats why i posted here and now

got my answer.Now will move ahead on tutorial.

Again thanks to all

That is good.
Thank you sir.i could be motivated just because of you otherwise i was going to quit RoR.

You could try and help Joanne(Yennie) with her problems

if you wished to make a contribution back to the Rails Community.
Why not!!

is there any mail from her side?

amritpalpathkgne.wordpress.com

Have you not seen her postings? One of the best ways to learn about a
subject is to read all the threads on the forum and for any questions
where you understand the question then make sure you understand the
answers. In no time you will find yourself answering questions. Her
thread subject is "Error of undefined method".

Colin

Also, you may want to read up more on routing.

Here’s a link to official guide, which does a great job of explaining

how

routing works in rails 3

http://guides.rubyonrails.org/routing.html

I have lost track of how many times Aritpal Pathak has been advised to

read that.

Sir this time i am your advice and reading it .i got the error while

following section number 2.6 on namespacing.Thats why i posted here and

now

got my answer.Now will move ahead on tutorial.

Again thanks to all

That is good.

 Thank you sir.i could be motivated just because of you otherwise i was

going to quit RoR.

You could try and help Joanne(Yennie) with her problems

if you wished to make a contribution back to the Rails Community.

Why not!!

is there any mail from her side?

Have you not seen her postings? One of the best ways to learn about a

subject is to read all the threads on the forum
ok will follow it.

and for any questions

where you understand the question then make sure you understand the

answers. In no time you will find yourself answering questions. Her

thread subject is “Error of undefined method”.

ok

amritpalpathakgne.wordpress.com