In my opinion you should let controller handle the size of your list, if it
is 'programs/1', 'programs/2' or 'programs/3' it will look for :controller
=> programs, :action => your_defined_action . So, in there in your action
you just need to manipulate the params[:id] and according to it generate
your data. For e.g. - if :id is 1 then generate your short_list, for 2
medium_list and for 3 long_list. Since, this all will be handle with in one
action defined with in a controller it will be very compact and DRY, and can
be viewed in a template. 3njoy :)

On Mon, Aug 22, 2011 at 5:33 PM, Erwin <yves_duf...@mac.com> wrote:

> thanks , That's better than what I did first,
>
> but is there any way to match to a specific name ( short_list,
> medium_list, long_list ) based upon the parameter 1, 2, 3
>
>
>
>
> On Aug 22, 1:12 pm, Surya <raj.sury...@gmail.com> wrote:
> > try to make it like this:
> >
> > match "programs/:id" => "Programs#your_action_name", :as => :list
> >
> > So in your controller 'Programs' you are able to handle the request with
> the
> > "id" which will be variable, and the path can be called by 'list_path'.
> The
> > action you'll call here will handle the request and you may then list the
> > rows accordingly.. :)
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Aug 22, 2011 at 4:31 PM, Erwin <yves_duf...@mac.com> wrote:
> > > I would like to have some  more  friendly URLS ...
> >
> > > I have some routes , with parameters I would like to rewrite but I
> > > don't know if it's possible :
> >
> > > /programs?list=1     =>   /short_list
> >
> > > /programs?list=2     =>   /medium_list
> >
> > > /programs?list=3     =>   /long_list
> >
> > > thanks for your feedback
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Ruby on Rails: Talk" group.
> > > To post to this group, send email to rubyonrails-talk@googlegroups.com
> .
> > > To unsubscribe from this group, send email to
> > > rubyonrails-talk+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/rubyonrails-talk?hl=en.
> >
> > --
> >
> > Please consider the environment before printing this email.
> >
> > Regards,
> > Surya
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>


-- 

Please consider the environment before printing this email.

Regards,
Surya

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to