Multi parent child class (rails) -
i have planning
class 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
Post a Comment