Sha256: 45953f385f1c2e08168e64053a950489e4a59ee6fe010ab8bcb6ca89189784c4

Contents?: true

Size: 765 Bytes

Versions: 2

Compression:

Stored size: 765 Bytes

Contents

class <%= controller_class_name %>Controller < ResourceController::Base
  
  before_filter :load_fxml_params
  
  index.wants.fxml            { render :fxml => @collection.to_fxml(@fxml_params) }
  show.wants.fxml             { render :fxml => @object.to_fxml(@fxml_params) }
  create.wants.fxml           { render :fxml => @object.to_fxml(@fxml_params) }
  create.failure.wants.fxml   { render :fxml => @object.errors }
  update.wants.fxml           { render :fxml => @object.to_fxml(@fxml_params) }
  update.failure.wants.fxml   { render :fxml => @object.errors }
  destroy.wants.fxml          { render :fxml => @object }

private

  def collection
    @collection = end_of_association_chain.all
  end
  
  def load_fxml_params
    @fxml_params = { }
  end
  
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dima-restfulx-1.2.2 rails_generators/rx_scaffold/templates/controllers/resource_controller.rb.erb
restfulx-1.2.2 rails_generators/rx_scaffold/templates/controllers/resource_controller.rb.erb