Hi everyone, The title is based on what I think is the solution to this problem: I need to have files available without, as far as the client is concerned, server processing. I know how to make http://www.myapp.com/flv/get/30 and it will return a flv file. The browser knows how to handle that, no problem, but some programs, like Flash, don''t. I can''t tell Flash to play http://www.myapp.com/flv/get/30 because it won''t know how to accept it. This is what I thought the solution would be, but if you know of other ways to do this, I''d greatly appreciate your help. It''s based on a solution to a similar problem I found here: http://tinyurl.com/ylnyzk How do I assign "variables" in routes.rb? For example: map.connect ''/flv/get/<make this into a variable>.flv'', :controller => ''flv'', :action => ''get'', :id => <variable> I hope that was clear. Thanks! -- Ramon Miguel M. Tayag --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> How do I assign "variables" in routes.rb? For example: > > map.connect ''/flv/get/<make this into a variable>.flv'', :controller => > ''flv'', :action => ''get'', :id => <variable>I am not sure if I understand the problem here. I think routes.rb comes with this: map.connect '':controller/:action/:id.:format'' which should take care of your case - request to flv/get/30.flv will be handled by flv_controller''s action ''get'' which will have access to params[:id] . Of course you can have your own route like map.connect ''flv/get/:movie_id.flv'' and in your controller retrieve :movie_id with params[:movie_id] Regards, Rimantas -- http://rimantas.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 -~----------~----~----~----~------~----~------~--~---
Great, that sounds like it''ll do the job. Thanks - I''ll try it when I wake up tom! Will post here my progress. Thanks! On 3/1/07, Rimantas Liubertas <rimantas-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > How do I assign "variables" in routes.rb? For example: > > > > map.connect ''/flv/get/<make this into a variable>.flv'', :controller => > > ''flv'', :action => ''get'', :id => <variable> > > I am not sure if I understand the problem here. > I think routes.rb comes with this: > map.connect '':controller/:action/:id.:format'' > > which should take care of your case - request to flv/get/30.flv will > be handled by flv_controller''s action ''get'' which will have access to > params[:id] . > > Of course you can have your own route like > > map.connect ''flv/get/:movie_id.flv'' > > and in your controller retrieve :movie_id with params[:movie_id] > > Regards, > Rimantas > -- > http://rimantas.com/-- Ramon Miguel M. Tayag --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It seems the problem was in the way the server would send the file to client. We used to use generate_file but it didn''t work. I thought the problem lay in the fact that there was no extension. We played around with it a bit more and tried send_file and the Flash player could read it just fine. Thanks Rimantas! On 3/2/07, Ramon Miguel M. Tayag <ramon.tayag-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Great, that sounds like it''ll do the job. > > Thanks - I''ll try it when I wake up tom! Will post here my progress.-- Ramon Miguel M. Tayag --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---