Is there a way to programmartically add a route? I have an outside process creating pages that I need to access, but I dont know their names or locations until runtime. -Janna B
Janna Brossard wrote:> Is there a way to programmartically add a route? I have an outside > process creating pages that I need to access, but I dont know their > names or locations until runtime. -Janna BJanna, Sounds messy! Are you sure this is the best option? What is it you''re trying to achieve? Gavin http://handyrailstips.com -- Posted via http://www.ruby-forum.com/.
I''m not sure but it seems possible to have a route at the end of your routes file (with the lowest priority) that would handle any un-handled requests. You could then dispatch it to wherever you want. Maybe there is a better way to do it though. Could you give some example URL''s? On Wed, Jul 8, 2009 at 4:07 AM, Gavin Morrice < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Janna Brossard wrote: > > Is there a way to programmartically add a route? I have an outside > > process creating pages that I need to access, but I dont know their > > names or locations until runtime. -Janna B > > Janna, > > Sounds messy! Are you sure this is the best option? > > What is it you''re trying to achieve? > > Gavin > > http://handyrailstips.com > -- > 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 -~----------~----~----~----~------~----~------~--~---
Well, for example. I was going to have it write partials into /public/ blahblah/_mypartial!.erb
Janna Brossard wrote:> Well, for example. I was going to have it write partials into /public/ > blahblah/_mypartial!.erbmap.connect "/blahblah/:partial_name", :controller => "yourcontroller", :action => "your_action" This would work provided you''re always routing to the same controller and action. I suppose in the action you''d just call something like def my_action render :partial => params[:partial_name] end not 100% sure if that would work the way you want it to though. Can you elaborate a little more? Gavin http://handyrailstips.com -- Posted via http://www.ruby-forum.com/.
Now that I think about it - don''t think this would work render looks through the view folders for your partial - not sure if you''d be able to store them in the public directory :S Gavi http://handyrailstips.com -- Posted via http://www.ruby-forum.com/.
You can add a static file system path to your render call with the :file option 2009/7/8, Gavin Morrice <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > Now that I think about it - don''t think this would work > > render looks through the view folders for your partial - not sure if > you''d be able to store them in the public directory > > :S > > Gavi > > http://handyrailstips.com > -- > Posted via http://www.ruby-forum.com/. > > > >-- Von meinen Mobilgerät aus gesendet