Closed edelwies closed 9 years ago
Faalis should use to attribute of a relation field to guess the model name. for example:
to
{ "name": "sections", "type": "has_many", "to": "work_steps" }
will generate this code in controller file:
def create # Section should be replaced by WorkStep --------------- sections = Section.where({:id => params[:order][:sections]}) # --------------------------------------------------------------------------- @order.sections = sections if @order.save respond_with(@order) else respond_to do |format| format.json { render :json => {:fields => @order.errors}, :status => :unprocessable_entity } end end end
We no longer need to define our resources via an external resource file. This feature removed from our previous versions too.
Faalis should use
to
attribute of a relation field to guess the model name. for example:will generate this code in controller file: