I want to write a permalink like /year/month/day/title, code is as follows:
self.permalink = "#{now.year}/#{now.month}/#{now.day}/#{title}"
in the view, I use restful url post_path(@post). And in the html source
code, the url is /posts/2008%2F4%2F30%2FTest
You can see, the ''/'' is replaced by "%2F", which is
not I expect.
How not to replace the ''/'' with "%2F"?
--
My home: http://flyerhzm.com
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
use url_for or just hard code it into the view [?] 2008/4/30 huang zhimin <flyerhzm@gmail.com>:> I want to write a permalink like /year/month/day/title, code is as follows: > > self.permalink = "#{now.year}/#{now.month}/#{now.day}/#{title}" > > in the view, I use restful url post_path(@post). And in the html source > code, the url is /posts/2008%2F4%2F30%2FTest > > You can see, the '/' is replaced by "%2F", which is not I expect. > How not to replace the '/' with "%2F"? > > > -- > My home: http://flyerhzm.com > > >--~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
is there any graceful method? On Wed, Apr 30, 2008 at 10:47 PM, Roger Pack <rogerpack2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> use url_for or just hard code it into the view [?] > > 2008/4/30 huang zhimin <flyerhzm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > I want to write a permalink like /year/month/day/title, code is as > follows: > > > > self.permalink = "#{now.year}/#{now.month}/#{now.day}/#{title}" > > > > in the view, I use restful url post_path(@post). And in the html source > > code, the url is /posts/2008%2F4%2F30%2FTest > > > > You can see, the ''/'' is replaced by "%2F", which is not I expect. > > How not to replace the ''/'' with "%2F"? > > > > > > -- > > My home: http://flyerhzm.com > > > > > > > > >-- My home: http://flyerhzm.com --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
url_for or what not 2008/4/30 huang zhimin <flyerhzm@gmail.com>:> is there any graceful method? > > > > > On Wed, Apr 30, 2008 at 10:47 PM, Roger Pack <rogerpack2005@gmail.com> > wrote: > > > use url_for or just hard code it into the view [?] > > > > 2008/4/30 huang zhimin <flyerhzm@gmail.com>: > > > > > > > > > I want to write a permalink like /year/month/day/title, code is as > follows: > > > > > > self.permalink = "#{now.year}/#{now.month}/#{now.day}/#{title}" > > > > > > in the view, I use restful url post_path(@post). And in the html source > > > code, the url is /posts/2008%2F4%2F30%2FTest > > > > > > You can see, the '/' is replaced by "%2F", which is not I expect. > > > How not to replace the '/' with "%2F"? > > > > > > > > > -- > > > My home: http://flyerhzm.com > > > > > > > > > > > > > > > > > -- > My home: http://flyerhzm.com > > >--~--~---------~--~----~------------~-------~--~----~ 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-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---