Sha256: 23a0ed85ccd8eb52d9ae0ea52d0e8c7d5ef67c59f2f2f67d552e1c01781dd702

Contents?: true

Size: 1.98 KB

Versions: 30

Compression:

Stored size: 1.98 KB

Contents

class VersionController < ApplicationController
  VERSION_FILE = '../build-info/version.txt'
  def display_version
    path = File.join(RAILS_ROOT, VERSION_FILE)
    render path
  end
end

class <%=nome%>Crud < RaroCrud
  titulo "<%nome.pluralize%>"
  subtitulo "Subtitulo", :index

  descricao "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", :index

  link_superior "Novo <%=nome%>", id: "novo-button", icon: "plus", link: "new"

  ordenar_por :created_at
  itens_por_pagina 5

  #Exemplo de acao customizada
  #acoes :associar, "Definir permissões", Proc.new {|p| Usuario.current.ability.can?(:create,p)}

  #Campos mostrados na index
  <%campos.each do |campo| %>
  campo_tabela <%=campo.to_sym%>,  label: "<%=campo.humanize%>"
  <%end

  #Campos mostrados no formulários de cadastro
  <%campos.each do |campo| %>
  campo_formulario <%=campo.to_sym%>,  label: "<%=campo.humanize%>"
  <%end
  
  #Campos mostrados na visualizacao
  <%campos.each do |campo| %>
  campo_visualizacao <%=campo.to_sym%>,  label: "<%=campo.humanize%>"
  <%end
  
  #Campos mostrados na busca
  <%campos.each do |campo| %>
  campo_busca <%=campo.to_sym%>,  label: "<%=campo.humanize%>"
  <%end
  
  #Exemplos de customizacao
  # Datepicker
  # campo_formulario :data,  label: "Data", as: :string, input_html: {class: "datepicker"}
  # Checkbox
  # campo_formulario :check,  label: "Check", input_html: {class: "i-checks"}
  # upload
  # campo_formulario :arquivo,  label: "Foto", input_html: {class: "ace-input-file"}
  # Relacionamento
  # campo_formulario :grupos, label: "Grupos",
  #                          label_method: :nome,
  #                          as: :check_boxes, 
  #                          input_html: {class: "i-checks"}
  # campo_busca :nome, model: 'Grupo', full_name: 'grupos_nome', label: "Nome"
  # escopos
  # escopos [[:maiores_que_1000, "Maiores"], [:menores_que_1000, "Menores"], [:ativos, "Ativos"], [:nao_ativos, "Desativos"]]
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
templus_models-1.4.4 lib/generators/crud/templates/crud2.rb
templus_models-1.4.3 lib/generators/crud/templates/crud2.rb
templus_models-1.4.2 lib/generators/crud/templates/crud2.rb
templus_models-1.4.1 lib/generators/crud/templates/crud2.rb
templus_models-1.4.0 lib/generators/crud/templates/crud2.rb
templus_models-1.3.9 lib/generators/crud/templates/crud2.rb
templus_models-1.3.8 lib/generators/crud/templates/crud2.rb
templus_models-1.3.7 lib/generators/crud/templates/crud2.rb
templus_models-1.3.6 lib/generators/crud/templates/crud2.rb
templus_models-1.3.4 lib/generators/crud/templates/crud2.rb
templus_models-1.3.3 lib/generators/crud/templates/crud2.rb
templus_models-1.3.2 lib/generators/crud/templates/crud2.rb
templus_models-1.3.1 lib/generators/crud/templates/crud2.rb
templus_models-1.3.0 lib/generators/crud/templates/crud2.rb
templus_models-1.2.8 lib/generators/crud/templates/crud2.rb
templus_models-1.2.7 lib/generators/crud/templates/crud2.rb
templus_models-1.2.6 lib/generators/crud/templates/crud2.rb
templus_models-1.2.5 lib/generators/crud/templates/crud2.rb
templus_models-1.2.4 lib/generators/crud/templates/crud2.rb
templus_models-1.2.3 lib/generators/crud/templates/crud2.rb