is that saying if params[:some_data] contains something not equal to nil, continue to the next line of code...else make params[:some_data] into an empty array? i tried searching for ||= but no luck. thanks for any help! -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
While on that question... Is there any reason I can set up config/routes.rb to had all of the URL except for the domain, no matter how many slashes or named parameters, to one ''FigureOutTheUrl'' controller? In that case, how do I deal with a variable number of slashes in the URL? -- We''ll give you your money back if not satisfied, but we do suspect that we will be quite satisfied with your money. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
what reason are you looking for? why do such a thing? Anton Aylward wrote:> While on that question... > > Is there any reason I can set up config/routes.rb to had all of the URL > except for the domain, no matter how many slashes or named parameters, > to > one ''FigureOutTheUrl'' controller? > > In that case, how do I deal with a variable number of slashes in the > URL? > > > -- > We''ll give you your money back if not satisfied, but we do suspect that > we will be quite satisfied with your money.-- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
On Feb 6, 10:44 am, mixplate <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> is that saying > > if params[:some_data] contains something not equal to nil, continue to > the next line of code...else make params[:some_data] into an empty > array? > > i tried searching for ||= but no luck. > > thanks for any help! > > -- > Posted viahttp://www.ruby-forum.com/.Yes, it initiates params[:some_data] as an array if it is null. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Yep, that''s what ||= means... and yes it is very difficult to search the web for symbolic stuff like that. If you have the Agile Rails book in pdf form however, you can search for that expression sucessfully. b mixplate wrote:> > is that saying > > if params[:some_data] contains something not equal to nil, continue to > the next line of code...else make params[:some_data] into an empty > array? > > > i tried searching for ||= but no luck. > > > thanks for any help! >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
One step beyond'' tressle''. A wiki with the syntax can be /web/topic No "controller", no "action". Defaults to "show" I would think that is what most users might expect. Only when you need to edit /web/topic?edit Some wiki have a topic that is the index page, like TWiki, so /web/index is a case of /web/topic and not /web action => ''index'' Which means you can write different styles of index pages - not need to hack the code. isn''t that what a wiki is about? mixplate said the following on 02/05/2007 08:01 PM:> > > what reason are you looking for? why do such a thing? > > Anton Aylward wrote: >> While on that question... >> >> Is there any reason I can set up config/routes.rb to had all of the URL >> except for the domain, no matter how many slashes or named parameters, >> to >> one ''FigureOutTheUrl'' controller? >> >> In that case, how do I deal with a variable number of slashes in the >> URL? >> >> >> -- >> We''ll give you your money back if not satisfied, but we do suspect that >> we will be quite satisfied with your money. > >-- Hi! I''m a signature virus! Copy me into your .signature file to help me spread! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2007-Feb-06 01:40 UTC
Re: params[:some_data] ||= [] #what does that mean?
> While on that question... > > Is there any reason I can set up config/routes.rb to had all of the URL > except for the domain, no matter how many slashes or named parameters, to > one ''FigureOutTheUrl'' controller? > > In that case, how do I deal with a variable number of slashes in the URL?Yes, just make sure it is *the* last url in routes.rb # # Catchall to handle redirects for old site urls # map.connect "*args", :controller => "url_mapper", :action => "index" I''d start with a controller action of: render :text => params.inspect to see what comes in and then go from there... -philip --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---