def create
      resource_set resource_klass.new(resource_params)

      respond_to do |wants|
        result = resource_get.save
        call_hook :after_save, result
        if result
          flash[:notice] = t 'messages.record_created', model: t("models.#{resource_name}")
          wants.html { redirect_to(resource_get) }
          wants.json  { render :json => resource_get, :status => :created, :location => resource }
        else
          wants.html { render :action => "new" }
          wants.json  { render :json => resource_get.errors, :status => :unprocessable_entity }
        end
      end
    end
def create
      resource_set resource_klass.new(resource_params)

      respond_to do |wants|
        result = resource_get.save
        call_hook :after_save, result
        if result
          flash[:notice] = t 'messages.record_created', model: t("models.#{resource_name}")
          wants.html { redirect_to(resource_get) }
          wants.json  { render :json => resource_get, :status => :created, :location => resource }
        else
          wants.html { render :action => "new" }
          wants.json  { render :json => resource_get.errors, :status => :unprocessable_entity }
        end
      end
    end
POST /resources
 POST /resources.json