Multi parent child class (rails) -


i have planningclass in app. class can belong 3 different classes (system, subsystem or subsubsystem) depending on users will. more clear: user must able create planning 1 of 3 classes.

i'm having no trouble models, in plannings_controller#new, don't know do.

this new method if mother-class system:

@system = system.find(params[:system_id]) @planning = @system.plannings.build  respond_to |format|   format.html # new.html.erb   format.json { render json: @planning } end 

end

can tell me way of managing plannings controller know class mother-class?

thanks lot!

if

multi parent child class

you referring multiple inheritance, know there no such thing in ruby.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -