Place to put parameter object in rails -


i'm new rails guy , have problem structure of rails.

my application structure this

- app - controllers -- orders_controller.rb - services -- get_customer.rb 

orderscontroller receive create order request , return new order. because order belongs customer. create service name getcustomer in order find or create new customer if not exists.

however, action method in getcustomer service receive long parameters. need extract parameter object. don't know place should put in ?

any advice graceful me ! thanks

hi questions not specific though here answer based on asked. in service can set instance variable specific param want. example below:

def initialize(params)   @phone= params[:phone]   @something = params[:somthing]   @email = params[:email] end 

you have list specific code if more specific answer.


Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -