Folks Quick question, i know db model logic goes into the model and how the views are interacted with goes into the controller code. And how the page looks goes into the view code with rails. But lets say i have a system call that shells out and runs a command that populates an array with a list of devices that i want to show in a select box in my view. Where would i put this type of system call at? Not sure if this goes into the controller or if this should be called from the view using a helper method, or should this go into the model. i know for long running external tasks i should use somthin like sidekiq but this an external call and is not expensive. so where is the best place to do things that happen from external calls and do not directly relate to the mvc? any advice would be helpfull 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 https://groups.google.com/groups/opt_out.
On 2 September 2012 19:23, brent brent <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Folks > Quick question, i know db model logic goes into the model and how the > views are interacted with goes into the controller code. And how the > page looks goes into the view code with rails. But lets say i have a > system call that shells out and runs a command that populates an array > with a list of devices that i want to show in a select box in my view. > Where would i put this type of system call at? Not sure if this goes > into the controller or if this should be called from the view using a > helper method, or should this go into the model. i know for long > running external tasks i should use somthin like sidekiq but this an > external call and is not expensive. so where is the best place to do > things that happen from external calls and do not directly relate to the > mvc? any advice would be helpfull thanks.Remember you can have models that are not derived from ActiveRecord so you could have a class to handle your external calls. Colin> > -- > 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 https://groups.google.com/groups/opt_out. > >-- 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 https://groups.google.com/groups/opt_out.
Colin Law wrote in post #1074344:> On 2 September 2012 19:23, brent brent <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> external call and is not expensive. so where is the best place to do >> things that happen from external calls and do not directly relate to the >> mvc? any advice would be helpfull thanks. > > Remember you can have models that are not derived from ActiveRecord so > you could have a class to handle your external calls. > > ColinThanks colin, i see now. I guess i could also do a mixin or module to bring it in via class that im currently using. Thats makin sense now. -- 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 https://groups.google.com/groups/opt_out.