Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Parent::Children controller
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Klaus Paiva  
View profile  
 More options Dec 31 2006, 4:31 am
From: Klaus Paiva <rails-mailing-l...@andreas-s.net>
Date: Sun, 31 Dec 2006 10:31:10 +0100
Local: Sun, Dec 31 2006 4:31 am
Subject: Parent::Children controller
Hello!

I'm creating a simple blog to test RoR. I've created an area to manage
my blog posts by using the "generate controller Admin::Posts". After
creating my actions, I can acess them by using:

http://localhost:3000/admin/posts/action_here

Everything working till here. But I would like to display a blog
overview here:

http://localhost:3000/admin/

So I've created an admin controller: "generate controller Admin" and an
"index" action. The new index action works but, the previous
posts/action_here not anymore.

I think that when I put /admin/posts on the URL and the controller admin
exists, I need to tell that I want to use the posts_controller, not the
admin_controller. Someone knows how can I do that?

Or if someone has a better idea to implement this I'll be grateful!

Thanks for your attention!

--
Posted via http://www.ruby-forum.com/.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Corcoran  
View profile  
 More options Jan 1 2007, 1:53 pm
From: "Paul Corcoran" <prcorco...@comcast.net>
Date: Mon, 01 Jan 2007 10:53:43 -0800
Local: Mon, Jan 1 2007 1:53 pm
Subject: Re: Parent::Children controller
Klaus,

You are correct in thinking that the admin/admin.rb file is screwing
things up. Nested controllers seem to work best when you split your
controllers in groups like: admin/xxx and admin/yyy. Your controllers
would then be under xxx or yyy but not split with some being directly
under admin. You need no special routing configuration to accomodate
this.

Perhaps your best solution right now is to just forget about nesting
the controllers and have it all under admin until you can see how
changing this structure would serve you better.

-Paul


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klaus Paiva  
View profile  
 More options Jan 3 2007, 6:57 am
From: "Klaus Paiva" <klaus.pa...@yahoo.com>
Date: Wed, 03 Jan 2007 03:57:28 -0800
Local: Wed, Jan 3 2007 6:57 am
Subject: Re: Parent::Children controller
Hi Paul,
thanks for your help!

I've found something useful on the book: - It's about the
config/routes.rb. In this file I can define when to use the post
controller by adding these lines:

# Admin::Posts
map.admin_posts 'admin/posts/:action/:id',
  :controller => 'admin/posts',
  :requirements => {
    :id => /\d+/
  }

That's it!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klaus Paiva  
View profile  
 More options Jan 3 2007, 7:00 am
From: Klaus Paiva <rails-mailing-l...@andreas-s.net>
Date: Wed, 3 Jan 2007 13:00:31 +0100
Local: Wed, Jan 3 2007 7:00 am
Subject: Re: Parent::Children controller
Hi Paul,
thanks for your help!

I've found something useful on the book: Agile Web Development with
Rails - It's about the config/routes.rb. In this file I can define when
to use the post controller by adding these lines:

# Admin::Posts
map.admin_posts 'admin/posts/:action/:id',
  :controller => 'admin/posts',
  :requirements => {
    :id => /\d+/
  }

That's it!

--
Posted via http://www.ruby-forum.com/.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klaus Paiva  
View profile  
 More options Jan 3 2007, 7:02 am
From: "Klaus Paiva" <klaus.pa...@yahoo.com>
Date: Wed, 03 Jan 2007 04:02:19 -0800
Local: Wed, Jan 3 2007 7:02 am
Subject: Re: Parent::Children controller
I forgot to paste the book name. :D

"Agile Web Development with Rails"


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Klaus Paiva  
View profile  
 More options Dec 31 2006, 3:50 am
From: "Klaus Paiva" <klaus.pa...@yahoo.com>
Date: Sun, 31 Dec 2006 00:50:26 -0800
Local: Sun, Dec 31 2006 3:50 am
Subject: Parent::Children controller
Hello!

I'm creating a simple blog to test RoR. I've created an area to manage
my blog posts by using the "generate controller Admin::Posts". After
creating my actions, I can acess them by using:

http://localhost:3000/admin/posts/action_here

Everything working till here. But I would like to display a blog
overview here:

http://localhost:3000/admin/

So I've created an admin controller: "generate controller Admin" and an
"index" action. The new index action works but, the previous
posts/action_here not anymore.

I think that when I put /admin/posts on the URL and the controller
admin exists, I need to tell that I want to use the posts_controller,
not the admin_controller. Someone knows how can I do that?

Or if someone has a better idea to implement this I'll be grateful!

Thanks for your attention!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andrew Skegg  
View profile  
 More options Jan 8 2007, 10:47 pm
From: Andrew Skegg <rails-mailing-l...@andreas-s.net>
Date: Tue, 9 Jan 2007 04:47:41 +0100
Local: Mon, Jan 8 2007 10:47 pm
Subject: Re: Parent::Children controller

One way would be to specify it in the config/routes.rb as such:
map.connect '/admin/posts/:action', :controller => 'posts'

Another might be to create a posts method in the admin controller and
have it redirect to the posts controller (passing all the values
across).

def posts
  redirect_to :controller => 'posts', :action => params[:action]
end

There is probably a better way to pass *all* of the params across -
anyone?

--
Posted via http://www.ruby-forum.com/.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross Riley  
View profile  
 More options Jan 9 2007, 1:56 am
From: "Ross Riley" <riley.r...@gmail.com>
Date: Tue, 9 Jan 2007 06:56:25 +0000
Local: Tues, Jan 9 2007 1:56 am
Subject: Re: [Rails] Re: Parent::Children controller
wouldn't.....
map.connect '/admin', :controller => 'admin/posts', :action=>'index'

have the desired effect?

On 1/9/07, Andrew Skegg <rails-mailing-l...@andreas-s.net> wrote:

--
Ross Riley
www.sorrylies.com

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »