Hi Rafael,
Hope the followings help:
1. the ordering of the matchers are important ... basically 1st come 1st serve
2. for better match, maybe u can do something like:
match('/questions/:stripped_title', :stripped_title =>
regexp).to(:controller => 'questions', :action =>
'show').name(:show_question)
3. if i'm not wrong, url() takes 2nd parameter as a hash, so maybe
url( :show_question, :stripped_title => ...) may help ?
cheers
==
On Wed, Mar 11, 2009 at 3:35 AM, Rafael George <[email protected]> wrote:
>
> I thought that adding this route
>
> match('/questions/:stripped_title').to(:controller => 'questions',
> :action => 'show').name(:show_question)
>
> But watching to the console i'm still getting the old 'id' thing from
> the resource_ful route.
>
> I have this in my view for calling that particular route.
>
> link_to question.title, url((:show_question, question.stripped_title)
>
> And i have this in my controller.
>
> def show(stripped_title)
> �...@question = Question.first(:stripped_title => stripped_title)
> ...
> end
>
> Any suggestion ?
>
> Thanks
>
> --
> Rafael George
>
> >
>
--
http://ngty77.blogspot.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---