Sha256: 229d4c4177af3a156527ec8212f32570fdf577c1fdfd3f64007960ad9ba6456f

Contents?: true

Size: 983 Bytes

Versions: 4

Compression:

Stored size: 983 Bytes

Contents

class <%=@model.name%>Crud < RaroCrud

  titulo "<%=@model.name.pluralize%>"

  link_superior "Novo <%=@model.name%>", id: "novo-button", icon: "plus", link: "new", can: Proc.new { Usuario.current.ability.can?(:create, <%=@model.name%>)}

  ordenar_por :created_at
  itens_por_pagina 20
  <%
    @atributos = @model.attribute_names
    @atributos.delete("id")
    @atributos.delete("created_at")
    @atributos.delete("updated_at")
    @atributos.map!{|e| e.gsub(/_id/,"")}
  %>
  <%@atributos.each do |atributo| %>campo_tabela :<%=atributo.to_sym%>,  label: "<%=atributo.humanize%>"<%="\n"%>  <%end%>
  <%@atributos.each do |atributo| %>campo_formulario :<%=atributo.to_sym%>,  label: "<%=atributo.humanize%>"<%="\n"%>  <%end%>
  <%@atributos.each do |atributo| %>campo_visualizacao :<%=atributo.to_sym%>,  label: "<%=atributo.humanize%>"<%="\n"%>  <%end%>
  <%@atributos.each do |atributo| %>campo_busca :<%=atributo.to_sym%>,  label: "<%=atributo.humanize%>"<%="\n"%>  <%end%>
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
raro_generator-0.1.1 lib/generators/rarocrud/crud/templates/crud.rb
raro_generator-0.1.0 lib/generators/rarocrud/crud/templates/crud.rb
raro_generator-0.0.4 lib/generators/rarocrud/crud/templates/crud.rb
raro_generator-0.0.3 lib/generators/rarocrud/crud/templates/crud.rb