Hi, I''m trying to put together a really simple application, which only uses Rails in the most rudimentary manner. Basically, I have a command line application that takes one parameter, and returns the necessary text in return. I also have an existing web site that can call a URL with a ?param. What I want to do, is have a simple controller which calls a system(...) call, passing the ?param to the non-rails application. I then want the view to display the result. I gather this is bone simple, and perhaps a little offensive to the spirit of Rails, but what can I say, baby steps.... Any help would be greatly appreciated. Thanks, Sig -- 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.
On 18 April 2011 21:11, Sig Luft <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I''m trying to put together a really simple application, which only uses > Rails in the most rudimentary manner. > > Basically, I have a command line application that takes one parameter, > and returns the necessary text in return. I also have an existing web > site that can call a URL with a ?param. > > What I want to do, is have a simple controller which calls a system(...) > call, passing the ?param to the non-rails application. > > I then want the view to display the result. I gather this is bone > simple, and perhaps a little offensive to the spirit of Rails, but what > can I say, baby steps....I suggest you work through some rails tutorials to see how rails works for typical applications rather than starting with something unusual (for rails). Then you should see how to do what you want. railstutorial.org is a good free-to-use-online tutorial. Also see the Rails Guides. Colin -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Nothing is simple. The only thing simple is to ask people how to do simple stuff. [?] On Mon, Apr 18, 2011 at 4:11 PM, Sig Luft <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I''m trying to put together a really simple application, which only uses > Rails in the most rudimentary manner. > > Basically, I have a command line application that takes one parameter, > and returns the necessary text in return. I also have an existing web > site that can call a URL with a ?param. > > What I want to do, is have a simple controller which calls a system(...) > call, passing the ?param to the non-rails application. > > I then want the view to display the result. I gather this is bone > simple, and perhaps a little offensive to the spirit of Rails, but what > can I say, baby steps.... > > Any help would be greatly appreciated. > > Thanks, > > Sig > > -- > 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. > >-- 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.
On 18 April 2011 21:11, Sig Luft <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi, > > I''m trying to put together a really simple application, which only uses > Rails in the most rudimentary manner.Hello, Given the simplicity of what you want to do, you might find it is better suited to Sinatra, as a very barebones framework. Rails comes with a lot of baggage and conventions, none of which you seem to need to use, so it strikes me that you don''t really need Rails. But if you *want* to use Rails, then the description you''ve given sounds to me like pretty good pseudo-code - just write it up in a controller action. You will *probably* want to look at the "backticks" (I''m not sure what it''s really called) method of calling a system command (at least, on *nix systems) as this returns the value the OS returned, rather than "system()" which displays the OS response but returns true/false: >> `ls` => "app\nconfig\ndb\ndoc\nlib\nlog\npublic\nRakefile\nscript\ntest\ntmp\nvendor\n" versus: >> system("ls") app config db doc lib log public Rakefile script test tmp vendor => true -- 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.