Uninitialized constant ApplicationController

On Tue, Jun 21, 2011 at 8:27 AM, Chirag S.
[email protected]wrote:

In which controller do you have the “click” action defined?
If it’s in the same controller

  yes it is in the same

then you need to define it in your routes too.

namespace :admin do
resources :posts, :collection => {:click => :post}
end
Did exactly
And in the code you had posted, the click method in your controller was
commented, so that may be the issue as well

uncommented it.

still no effect…:stuck_out_tongue:

amritpalpathakgne.wordpress.com

On Tue, Jun 21, 2011 at 8:52 AM, Chirag S.
[email protected]wrote:

Try this then
no it haven’t work too.

undefined local variable or method `click_admin_posts_path' for

#<#Class:0xb6675348:0xb66732a0>

amritpalpathakgne.wordpress.com

On Tue, Jun 21, 2011 at 9:09 AM, Chirag S.
[email protected]wrote:

Can you paste the code from your routes file here?

On Tue, Jun 21, 2011 at 6:26 PM, amritpal pathak
[email protected]wrote:


Chirag
http://sumeruonrails.com

On Tue, Jun 21, 2011 at 9:21 AM, Colin L. [email protected]
wrote:

get “gne/clg”

root :to => “posts#work”

Can you explain what these two routes are doing?

    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.

On Tue, Jun 21, 2011 at 7:04 PM, amritpal pathak
[email protected]wrote:

#resources :posts do
should the changes be in these 2 routes for namespacing rather than as:
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Chirag
http://sumeruonrails.com

On 21 June 2011 14:16, amritpal pathak [email protected]
wrote:

#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

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

On Tue, Jun 21, 2011 at 7:04 PM, amritpal pathak
[email protected]wrote:

#resources :posts do
should the changes be in these 2 routes for namespacing rather than as:
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Chirag
http://sumeruonrails.com

On 21 June 2011 14:44, Chirag S. [email protected] wrote:

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
Rails Routing from the Outside In — Ruby on Rails Guides

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

On 21 June 2011 14:59, Colin L. [email protected] wrote:

Also you might like to try getting him to post the result
of rake routes.

ROFLMAO :slight_smile:

On Tue, Jun 21, 2011 at 9:44 AM, Chirag S.
[email protected]wrote:

On Tue, Jun 21, 2011 at 9:42 AM, Chirag S.
[email protected]wrote:

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

On 21 June 2011 17:06, amritpal pathak [email protected]
wrote:

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. You could try and help Joanne(Yennie) with her problems
if you wished to make a contribution back to the Rails Community.

Colin

On Tue, Jun 21, 2011 at 9:59 AM, Colin L. [email protected]
wrote:

On 21 June 2011 14:44, Chirag S. [email protected] wrote:

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
Rails Routing from the Outside In — Ruby on Rails Guides

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

amritpalpathakgne.wordpress.com

On 21 June 2011 17:22, amritpal pathak [email protected]
wrote:

On 21 June 2011 14:44, Chirag S. [email protected] wrote:
following section number 2.6 on namespacing.Thats why i posted here and
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 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

On Tue, Jun 21, 2011 at 12:18 PM, Colin L. [email protected]
wrote:

routing works in rails 3

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

On Tue, Jun 21, 2011 at 12:35 PM, Colin L. [email protected]
wrote:

On Tue, Jun 21, 2011 at 9:59 AM, Colin L. [email protected]

Again thanks to all
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