Alpha Blue
2010-Jan-06 20:35 UTC
Create route for external file using get with no controller
I created a special flash file that will read tag cloud variables from an external text file which will be located in the same directory as the swf. The tags are kept in the database and once per day a definitions.txt file is created with the population of the tags, the ref, and the weight. My swf file and the external file called definitions.txt are located in public\swf\. The swf will call a method of get and need to be able to retrieve the data from that file. How can I create a named route in routes.rb to accomplish this without a controller present for this action? public\swf\example.swf public\swf\definitions.txt example.swf will attempt to load definitions.txt from the same directory Any help would be appreciated. I thought I was pretty savvy with routes but I''ve hit a brick wall. Thanks. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
pharrington
2010-Jan-06 20:44 UTC
Re: Create route for external file using get with no controller
On Jan 6, 3:35 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I created a special flash file that will read tag cloud variables from > an external text file which will be located in the same directory as the > swf. The tags are kept in the database and once per day a > definitions.txt file is created with the population of the tags, the > ref, and the weight. > > My swf file and the external file called definitions.txt are located in > public\swf\. > > The swf will call a method of get and need to be able to retrieve the > data from that file. How can I create a named route in routes.rb to > accomplish this without a controller present for this action? > > public\swf\example.swf > public\swf\definitions.txt > > example.swf will attempt to load definitions.txt from the same directory > > Any help would be appreciated. I thought I was pretty savvy with routes > but I''ve hit a brick wall. > > Thanks. > -- > Posted viahttp://www.ruby-forum.com/.This isn''t what rails routing does (half of routing is pointless here, as with a sane setup the request never even hits the rails app). If you only want a handy method of linking to the text file from your app, just create a helper method or a constant. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Alpha Blue
2010-Jan-06 21:00 UTC
Re: Create route for external file using get with no controller
pharrington wrote:> On Jan 6, 3:35 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> data from that file. How can I create a named route in routes.rb to >> Thanks. >> -- >> Posted viahttp://www.ruby-forum.com/. > > This isn''t what rails routing does (half of routing is pointless here, > as with a sane setup the request never even hits the rails app). > > If you only want a handy method of linking to the text file from your > app, just create a helper method or a constant.I don''t need a link. I need a route. There is no link. No one is clicking any link on any page. The SWF is embedded on the page. The SWF is attempting to pull data from a text file in its root directory. If it can be done with a helper method - great, how? If not, I''m back to square one and need someone to answer my question. -- Posted via http://www.ruby-forum.com/. --001485e9a570a46343047c853e12 Content-Type: text/plain; charset=ISO-8859-1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. --001485e9a570a46343047c853e12--
Conrad Taylor
2010-Jan-06 21:10 UTC
Re: Create route for external file using get with no controller
On Wed, Jan 6, 2010 at 12:35 PM, Alpha Blue <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I created a special flash file that will read tag cloud variables from > an external text file which will be located in the same directory as the > swf. The tags are kept in the database and once per day a > definitions.txt file is created with the population of the tags, the > ref, and the weight. > > My swf file and the external file called definitions.txt are located in > public\swf\. > > The swf will call a method of get and need to be able to retrieve the > data from that file. How can I create a named route in routes.rb to > accomplish this without a controller present for this action? > >This really has nothing to do with the Rails or Rails routing system. If you''re wanting to simply do the following: a) pull data from the db b) store this date into a file c) read this data via ActionScript If my understanding is correct, you can write a simply Ruby script to pull the information from the db and write it out to a file. Next, is this file being created at a particular interval? If so, you can use cron to call this script. It''s not clear from your initial e-mail as to when you''ll be creating this new file. -Conrad> public\swf\example.swf > public\swf\definitions.txt > > example.swf will attempt to load definitions.txt from the same directory > > Any help would be appreciated. I thought I was pretty savvy with routes > but I''ve hit a brick wall. > > Thanks. > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
pharrington
2010-Jan-06 21:11 UTC
Re: Create route for external file using get with no controller
On Jan 6, 4:00 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> pharrington wrote: > > On Jan 6, 3:35 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> data from that file. How can I create a named route in routes.rb to > >> Thanks. > >> -- > >> Posted viahttp://www.ruby-forum.com/. > > > This isn''t what rails routing does (half of routing is pointless here, > > as with a sane setup the request never even hits the rails app). > > > If you only want a handy method of linking to the text file from your > > app, just create a helper method or a constant. > > I don''t need a link. I need a route. There is no link. No one is > clicking any link on any page. The SWF is embedded on the page. The > SWF is attempting to pull data from a text file in its root directory. > If it can be done with a helper method - great, how? > > If not, I''m back to square one and need someone to answer my question. > -- > Posted viahttp://www.ruby-forum.com/.Ok. The text file''s in the app''s /public directory... you don''t need a route. That is what /public is for; a directory to serve static files directly via the web server, *bypassing* your app. Just access it from your swf like you would any other resource thats in /public. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Alpha Blue
2010-Jan-06 21:15 UTC
Re: Create route for external file using get with no controller
pharrington wrote:> On Jan 6, 4:00 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> > If you only want a handy method of linking to the text file from your >> > app, just create a helper method or a constant. >> >> I don''t need a link. I need a route. There is no link. No one is >> clicking any link on any page. The SWF is embedded on the page. The >> SWF is attempting to pull data from a text file in its root directory. >> If it can be done with a helper method - great, how? >> >> If not, I''m back to square one and need someone to answer my question. >> -- >> Posted viahttp://www.ruby-forum.com/. > > Ok. The text file''s in the app''s /public directory... you don''t need a > route. That is what /public is for; a directory to serve static files > directly via the web server, *bypassing* your app. Just access it from > your swf like you would any other resource thats in /public.Thanks mate. This is what I didn''t realize. I moved the file definitions.txt to public\ and everything is working fine now. I appreciate the clarification. -- Posted via http://www.ruby-forum.com/. --0022158df84fa2de8a047c8573b2 Content-Type: text/plain; charset=ISO-8859-1 -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. --0022158df84fa2de8a047c8573b2--