Sha256: ad8bd7ead3a3d6c05f5a536b82b0ec0a56b5ddf5c5596b99909795c584ce7916
Contents?: true
Size: 909 Bytes
Versions: 4
Compression:
Stored size: 909 Bytes
Contents
class <%= nom_clase_plural %>Controller < Msip::ModelosController helper ::ApplicationHelper before_action :set_<%= nom_arch %>, only: [:show, :edit, :update, :destroy] load_and_authorize_resource class: ::<%= nom_clase %> def clase "::<%= nom_clase %>" end def atributos_index [ :id ] end def atributos_form [ :id ] end def index_reordenar(registros) return registros.reorder(:id) end def new_modelo_path(o) return new_<%= nom_arch %>_path() end def genclase return 'F' end private def set_<%= nom_arch %> @registro = @<%= nom_arch %> = ::<%= nom_clase %>.find( ::<%= nom_clase %>.connection.quote_string(params[:id]).to_i ) end # No confiar parametros a Internet, sólo permitir lista blanca def <%= nom_arch %>_params params.require(:<%= nom_arch %>).permit(*atributos_form) end end
Version data entries
4 entries across 4 versions & 1 rubygems