code stringlengths 1 1.73M | language stringclasses 1
value |
|---|---|
class ReciboMailer < ActionMailer::Base
add_template_helper(UtilHelper)
add_template_helper(ApplicationHelper)
def recibo_email(recibo)
recipients recibo.usuario.email
from "Administracion"
subject "Recibo de #{recibo.tipo} #{recibo.mes} - #{recibo.anho}"
sent_on Time.now
body ... | Ruby |
class VacacionAntiguedad < ActiveRecord::Base
validates_presence_of :desde,:dias
def self.dias_por_antiguedad(antiguedad)
va=VacacionAntiguedad.find(:first, :conditions => ['(?>=desde and ?<=hasta) OR (?>=desde and hasta is ?)',antiguedad, antiguedad, antiguedad,nil])
va.nil? ? 0 : va.dias
end
end
| Ruby |
class ResultadoCompetencia < ActiveRecord::Base
belongs_to :usuario
belongs_to :evaluacion
belongs_to :competencia
named_scope :por_evaluacion , lambda{ |evaluacion| {:conditions => ["evaluacion_id= '#{evaluacion.id}'"]}}
end
| Ruby |
class Hora < ActiveRecord::Base
MAusencia=0
MHorasInsuficientes=1
MHorasExtras=2
MHorasCompensadas=3
TDescuentos=[MAusencia,MHorasInsuficientes]
belongs_to :usuario
belongs_to :hora, :foreign_key=>:compensada_id,:dependent=>:destroy
belongs_to :proceso,:class_name=>'HoraProceso'
has_one :hora_compensa... | Ruby |
class Sucursal < ActiveRecord::Base
belongs_to :empresa
validates_presence_of :nombre
default_scope :order => :nombre
has_many :feriados
has_many :usuarios
has_many :recibos
delegate :nombre, :to => :empresa, :prefix => true
def self.alljq
data=[]
data<<"'':Todos"
Sucursal.all.each{ |s|data<<... | Ruby |
class Horario < ActiveRecord::Base
belongs_to :grupo_horario
DIAS = [:lunes,:martes,:miercoles,:jueves,:viernes,:sabado,:domingo]
end
| Ruby |
class Examen < ActiveRecord::Base
belongs_to :usuario
belongs_to :tipo_examen
validates_presence_of :usuario_id
validates_presence_of :fecha
validates_presence_of :medico
validates_presence_of :entidad
validates_presence_of :resultado
def aprobado
if self.apto
"Si"
else
"No"
end... | Ruby |
class TipoReconocimiento < ActiveRecord::Base
has_many :reconocimientos
validates_presence_of :nombre
end
| Ruby |
class Movimiento < ActiveRecord::Base
validates_presence_of :usuario_id
validates_presence_of :valor
validates_presence_of :fecha
validates_presence_of :tipo_movimiento_id
validates_numericality_of :valor, :greater_than => 0
belongs_to :usuario
belongs_to :importacion
belongs_to :tipo_movimiento
belon... | Ruby |
class PlantillasController < ApplicationController
#MODULE: Configuraciones
# GET /plantillas
# GET /plantillas.xml
def index
@plantillas = Plantilla.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @plantillas }
end
end
# GET... | Ruby |
class ProcesosController < ApplicationController
#MODULE: Configuraciones
# GET /procesos
# GET /procesos.xml
def index
end
# GET /procesos/1
# GET /procesos/1.xml
def show
@proceso = Proceso.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :... | Ruby |
class ExamenesController < ApplicationController
# MODULE: Ficha Médica
#
# GET /examenes
# GET /examenes.xml
def index
@examenes = Examen.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @examenes }
end
end
# GET /examenes/1
# GET /examenes/... | Ruby |
class UtilitariosController < ApplicationController
#MODULE: Utilitarios
def index
end
end
| Ruby |
class HorariosController < ApplicationController
#MODULE: Horarios
def index
end
end
| Ruby |
class IdiomasController < ApplicationController
#MODULE: Configuraciones
# GET /idiomas
# GET /idiomas.xml
def index
@idiomas = Idioma.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @idiomas }
end
end
# GET /idiomas/1
# GET /idiomas... | Ruby |
class FranjasController < ApplicationController
#MODULE: Configuraciones
# GET /franjas
# GET /franjas.xml
def index
@franjas = Franja.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @franjas }
end
end
# GET /franjas/1
# GE... | Ruby |
class BancosController < ApplicationController
#MODULE: Configuraciones
# GET /bancos
# GET /bancos.xml
def index
end
# GET /bancos/1
# GET /bancos/1.xml
def show
@banco = Banco.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @... | Ruby |
class PrestamosController < ApplicationController
#MODULE: Gestión Salarial
#ACTIONS: scaffold
# GET /prestamos
# GET /prestamos.xml
def index
end
# GET /prestamos/1
# GET /prestamos/1.xml
def show
@prestamo = Prestamo.find(params[:id])
respond_to do |format|
format.html # show.html.erb
... | Ruby |
class PerfilesController < ApplicationController
#MODULE: Configuraciones
# GET /perfiles
# GET /perfiles.xml
before_filter :set_modulos, :only=>[:show,:new,:edit]
def index
end
# GET /perfiles/1
# GET /perfiles/1.xml
def show
@perfil = Perfil.find(params[:id])
respond_to do |format|
f... | Ruby |
class AreasController < ApplicationController
#MODULE: Configuraciones
# GET /areas
# GET /areas.xml
def index
end
# GET /areas/1
# GET /areas/1.xml
def show
@area = Area.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @area }
... | Ruby |
class CategoriasController < ApplicationController
#MODULE: Configuraciones
# GET /categorias
# GET /categorias.xml
def index
@categorias = Categoria.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @categorias }
end
end
# GET /... | Ruby |
class EmpresasController < ApplicationController
#MODULE: Configuraciones
# GET /empresas
# GET /empresas.xml
def index
end
# GET /empresas/1
# GET /empresas/1.xml
def show
@empresa = Empresa.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :... | Ruby |
require 'iconv'
class IncidentesController < ApplicationController
#MODULE: Evaluaciones
before_filter :find_usuario
before_filter :datos_premiacion,:only=>[:premiar,:premio]
# GET /incidentes
# GET /incidentes.xml
def controller_name
@controller_name= "Hechos Significativos"
end
def index
en... | Ruby |
require "csv"
require 'tempfile'
class ImportacionesController < ApplicationController
#MODULE: Utilitarios
# GET /importaciones
# GET /importaciones.xml
def index
end
# GET /importaciones/1
# GET /importaciones/1.xml
def show
@importacion = Importacion.find(params[:id])
if @importacion.model... | Ruby |
class ModelosController < ApplicationController
#MODULE: Utilitarios
# GET /modelos
# GET /modelos.xml
def index
end
# GET /modelos/1
# GET /modelos/1.xml
def show
@modelo = Modelo.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @m... | Ruby |
class DocumentosController < ApplicationController
# MODULE: Documentos
# GET /documentos
# GET /documentos.xml
def index
@documentos = Documento.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @documentos }
end
end
# GET /documentos/1
# GET /... | Ruby |
class TiposExamenesController < ApplicationController
#MODULE: Configuraciones
# GET /tipos_examenes
# GET /tipos_examenes.xml
def index
@tipos_examenes = TipoExamen.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @tipos_examenes }
end
end
# GET... | Ruby |
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
include ExceptionNotifiable
include Jqgrid
#Funcionalidad para Popups
include FormHelper
layout :select... | Ruby |
class FeriadosController < ApplicationController
#MODULE: Configuraciones
# GET /feriados
# GET /feriados.xml
def index
@feriados = Feriado.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @feriados }
end
end
# GET /feriados/1... | Ruby |
class MensajesController < ApplicationController
# GET /mensajes
# GET /mensajes.xml
def index
end
# GET /mensajes/1
# GET /mensajes/1.xml
def show
@mensaje = Mensaje.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @mensaje }
... | Ruby |
class MotivosSalidasController < ApplicationController
#MODULE: Configuraciones
# GET /motivos_salidas
# GET /motivos_salidas.xml
def index
@motivos_salidas = MotivoSalida.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @motivos_salidas }
e... | Ruby |
class FormacionesController < ApplicationController
# MODULE: Formaciones
# GET /formaciones
# GET /formaciones.xml
def index
@formaciones = Formacion.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @formaciones }
end
end
# GET /formaciones/1
... | Ruby |
class CompetenciasController < ApplicationController
#MODULE: Configuraciones
def index
end
def show
redirect_to competencias_cargos_path(:competencia_id => params[:id])
end
def new
@competencia = Competencia.new
respond_to do |format|
format.html # new.html.erb
format.xml { render... | Ruby |
class PredefinidosController < ApplicationController
#MODULE: Configuraciones
# GET /predefinidos
# GET /predefinidos.xml
def index
end
# GET /predefinidos/1
# GET /predefinidos/1.xml
def show
@predefinido = Predefinido.find(params[:id])
respond_to do |format|
format.html # show.html.erb
... | Ruby |
class MarcacionesController < ApplicationController
#MODULE: Horarios
def show_descargar_ficha_marcacion #DESC: Descargar Ficha de Marcaciones.
respond_to do |format|
format.html {render :layout => false}
end
end
def descargar_ficha_marcacion #IGNORE
respond_to do |format|
format.pdf... | Ruby |
class LogsController < ApplicationController
#DESC: Monitoreo de acciones realizadas en el Bitacorh.
#MODULE: Utilitarios
# GET /logs
# GET /logs.xml
def index
end
# GET /logs/1
# GET /logs/1.xml
def show
@log = Log.find(params[:id])
respond_to do |format|
format.html # show.html.e... | Ruby |
class FamiliaresController < ApplicationController
#MODULE: Datos Familiares
before_filter :cargar_usuario
# GET /familiares
# GET /familiares.xml
def index
@familiares = @usuario.familiares.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @familiares... | Ruby |
class CuentasController < ApplicationController
#MODULE: Configuraciones
# GET /cuentas
# GET /cuentas.xml
def index
end
# GET /cuentas/1
# GET /cuentas/1.xml
def show
@cuenta = Cuenta.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xm... | Ruby |
class EvaluadosController < ApplicationController
# MODULE: Evaluaciones
before_filter :find_usuario
before_filter :find_and_update_evaluado_conclucion, :only => [:create, :update]
def index
@evaluaciones = Evaluacion.find(:all,:conditions=>"terminada = 0 or terminada is null")
end
def show
@eval... | Ruby |
class PremiacionesEscalasController < ApplicationController
# GET /premiaciones_escalas
# GET /premiaciones_escalas.xml
def index
@premiaciones_escalas = PremiacionEscala.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @premiaciones_escalas }
... | Ruby |
class TiposMovimientosController < ApplicationController
#MODULE: Configuraciones
# GET /tipos_movimientos
# GET /tipos_movimientos.xml
def index
end
# GET /tipos_movimientos/1
# GET /tipos_movimientos/1.xml
def show
@tipo_movimiento = TipoMovimiento.find(params[:id])
respond_to do |format... | Ruby |
class FactoresReconocimientosController < ApplicationController
# GET /factores_reconocimientos
# GET /factores_reconocimientos.xml
def index
@factores_reconocimientos = FactorReconocimiento.generales
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @f... | Ruby |
class HistoricosInternosController < ApplicationController
#MODULE: Historial Laboral
# GET /historicos_internos
# GET /historicos_internos.xml
def index #IGNORE
@historicos_internos = HistoricoInterno.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :x... | Ruby |
class TareasController < ApplicationController
# GET /tareas
# GET /tareas.xml
def index
end
# GET /tareas/1
# GET /tareas/1.xml
def show
@tarea = Tarea.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @tarea }
end
end
# GET /... | Ruby |
#TODO: VER COMO CAMBIAR EL CONTROL DE LIBERADO POR CAJA, YA QUE "usuario.num_cuenta.to_i==0"
#no es retro activo. SUG.: Agregar un campo a recibo que determine si el recibo fue liberado por caja o no.
class SueldosController < ApplicationController
#MODULE: Gestión Salarial
Formatos=[["Planilla",0],["Interbanco",1]... | Ruby |
class CargosController < ApplicationController
#MODULE: Configuraciones
before_filter :find_jerarquia, :only => [:edit, :show]
# GET /cargos
# GET /cargos.xml
def index
end
# GET /cargos/1
# GET /cargos/1.xml
def show
respond_to do |format|
format.html # show.html.erb
format.xml { re... | Ruby |
class SucursalesController < ApplicationController
#MODULE: Configuraciones
#ACTIONS: scaffold
include Jqgrid
# GET /sucursales
# GET /sucursales.xml
def index
respond_to do |format|
format.html # show.html.erb
format.combo { render :file => "sucursales/index.combo.erb" }
end
end
... | Ruby |
class TiposContratosController < ApplicationController
#MODULE: Configuraciones
# GET /tipos_contratos
# GET /tipos_contratos.xml
def index
@tipos_contratos = TipoContrato.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @tipo_contrato }
end... | Ruby |
class PlanesHorariosController < ApplicationController
#MODULE: Horario Laboral
# GET /planes_horarios
# GET /planes_horarios.xml
def index
@planes_horarios = PlanHorario.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @planes_horarios }
end
end
... | Ruby |
class TiposReconocimientosController < ApplicationController
#MODULE: Configuraciones
# GET /tipos_reconocimientos
# GET /tipos_reconocimientos.xml
def index
@tipos_reconocimientos = TipoReconocimiento.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :x... | Ruby |
class TiposCursosController < ApplicationController
#MODULE: Configuraciones
# GET /tipos_cursos
# GET /tipos_cursos.xml
def index
end
# GET /tipos_cursos/1
# GET /tipos_cursos/1.xml
def show
@tipo_curso = TipoCurso.find(params[:id])
respond_to do |format|
format.html # show.html.er... | Ruby |
class SesionesUsuarioController < ApplicationController
skip_before_filter :require_login
skip_before_filter :check_perfil
def new
unless current_user
@sesion_usuario = SesionUsuario.new
else
redirect_to micuenta_usuarios_path
end
end
def create
@sesion_usuario = SesionUsuario... | Ruby |
class NivelesController < ApplicationController
#MODULE: Configuraciones
# GET /niveles
# GET /niveles.xml
def index
@niveles = Nivel.all
@columnas = Array.new()
@columnas[0]="Valoracion"
@columnas[1]="Nivel"
@niveles.each do |nivel|
nivel.categorizaciones.each do |categoriza... | Ruby |
class CarpetasController < ApplicationController
#MODULE: Configuraciones
# GET /carpetas
# GET /carpetas.xml
def index
@carpetas = Carpeta.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @carpetas }
end
end
# GET /carpetas/1... | Ruby |
class MovimientosController < ApplicationController
#MODULE: Gestión Salarial
# GET /movimientos
# GET /movimientos.xml
def index
end
# GET /movimientos/1
# GET /movimientos/1.xml
def show
@movimiento = Movimiento.find(params[:id])
respond_to do |format|
format.html {render :layout=>!para... | Ruby |
class TalentosController < ApplicationController
#MODULE: Configuraciones
# GET /talentos
# GET /talentos.xml
def index #DESC: Listar taletos.
@talentos = Talento.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @talentos }
end
end
# GE... | Ruby |
class IdiomasUsuariosController < ApplicationController
# MODULE: Idiomas
#
# GET /idiomas_usuarios
# GET /idiomas_usuarios.xml
def index
@idiomas_usuarios = IdiomaUsuario.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @idiomas_usuarios }
end
end... | Ruby |
class AutorizacionesController < ApplicationController
#MODULE: Horarios
# GET /autorizaciones
# GET /autorizaciones.xml
def index
@autorizaciones = Autorizacion.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @autorizaciones }
end
end
#... | Ruby |
class HistoricosExternosController < ApplicationController
#MODULE: Historial Laboral
# GET /historicos_externos
# GET /historicos_externos.xml
def index #IGNORE
@historicos_externos = HistoricoExterno
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @histo... | Ruby |
class HechosController < ApplicationController
#MODULE: Configuraciones
# GET /hechos
# GET /hechos.xml
def index
end
# GET /hechos/1
# GET /hechos/1.xml
def show
@hecho = Hecho.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @hech... | Ruby |
class RecibosController < ApplicationController
#MODULE: Gestión Salarial
# GET /recibos
# GET /recibos.xml
def index
end
def email #DESC: Enviar por mail los recibos.
if params[:date]
@rechazados = []
@enviados = 0
lista = Recibo.find(:all, :conditions => ["mes = ? and anho = ? AND a... | Ruby |
class PlanesAccionesController < ApplicationController
#MODULE: Evaluaciones
before_filter :find_usuario
def index
end
def show
@plan_accion = PlanAccion.find params[:id]
respond_to do |format|
format.html # new.html.erb
format.js { render :layout => false}
format.xml { render :... | Ruby |
class SolicitudesDocumentoController < ApplicationController
#MODULE: Utilitarios
# GET /solicitudes_documento
# GET /solicitudes_documento.xml
def index
end
# GET /solicitudes_documento/1
# GET /solicitudes_documento/1.xml
def show
@solicitud_documento = SolicitudDocumento.find(params[:id])
... | Ruby |
class VacacionesController < ApplicationController
#MODULE: Vacaciones
# GET /vacaciones
# GET /vacaciones.xml
def index
@vacaciones = Vacacion.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @vacaciones }
end
end
# GET /vacaciones/1
# GET /va... | Ruby |
class VestimentasController < ApplicationController
#MODULE: Configuraciones
# GET /vestimentas
# GET /vestimentas.xml
def index
@vestimentas = Vestimenta.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @vestimentas }
end
end
# GET /vestimenta... | Ruby |
class ConfiguracionesController < ApplicationController
#MODULE: Configuraciones
def index
end
end
| Ruby |
class TiposDocumentosController < ApplicationController
#MODULE: Configuraciones
# GET /tipos_documentos
# GET /tipos_documentos.xml
def index
@tipos_documentos = TipoDocumento.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @tipos_documentos }... | Ruby |
class VacacionesAntiguedadesController < ApplicationController
#MODULE: Configuraciones
# GET /vacaciones_antiguedades
# GET /vacaciones_antiguedades.xml
def index
@vacaciones_antiguedades = VacacionAntiguedad.all
respond_to do |format|
format.html # index.html.erb
format.xml { r... | Ruby |
class CorrientesController < ApplicationController
#MODULE: Configuraciones
before_filter :cargar_empresa
# GET /corrientes
# GET /corrientes.xml
def index
@corrientes = @empresa.try(:corrientes)
@index = true
respond_to do |format|
format.html # index.html.erb
format.xml { render :... | Ruby |
class UsuariosController < ApplicationController
before_filter :set_modulos#, :only=>[:show,:micuenta,:new,:edit,:actualizar_datos]
#DESC: Acciones relacionadas a los usuarios
#MODULE: Gestión de personas
def lugar_actual #IGNORE
if @usuario
"#{controller_name}: #{action_name} - #{@usuario.nombre}... | Ruby |
class GruposHorariosController < ApplicationController
#MODULE: Configuraciones
# GET /grupos_horarios
# GET /grupos_horarios.xml
def index
@grupos_horarios = GrupoHorario.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @grupos_horarios }
end
end
... | Ruby |
class EvaluacionesController < ApplicationController
#MODULE: Configuraciones
before_filter :inicializar_preguntas, :only => :update
before_filter :require_admin_user
def reiniciar_datos #IGNORE
@evaluacion=Evaluacion.find(params[:id])
ids=UsuarioDato.por_evaluacion(@evaluacion).map(&:id)
cant1=Usu... | Ruby |
class ColumnasController < ApplicationController
# GET /columnas
# GET /columnas.xml
def index
@columnas = Columna.paginate :page => params[:page]
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @columnas }
end
end
# GET /columnas/1
# GET /columnas... | Ruby |
class ReconocimientosController < ApplicationController
#MODULE: Reconocimientos
# GET /reconocimientos
# GET /reconocimientos.xml
def index
@reconocimientos = Reconocimiento.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @reconocimientos }
end
... | Ruby |
class HorasController < ApplicationController
#MODULE: Horarios
def liquidar #DESC: Convertir las horas trabajadas en movimientos a considerar en el recibo.
if request.method==:post
@inicio=Date.new(params[:date][:year].to_i,params[:date][:month].to_i)
cant=Hora.liquidar(@inicio)
flash[:notice... | Ruby |
class CompetenciasCargosController < ApplicationController
before_filter :inicializar_descripciones, :only => :update
before_filter :redirect_to_unless_competencia, :only => [:index]
before_filter :find_competencia, :only => [:index]#, :new, :create, :update]
def index
# @competencia = Compete... | Ruby |
class PopupController < ApplicationController
layout false
def buscar
opciones = params[:opciones]
opciones[:conditions] ||= {}
#logger.info "filter_#{opciones[:clase].downcase}"
opciones[:conditions] = session["filter_#{opciones[:clase].downcase}"].merge(opciones[:conditions]) if session["filter_#{... | Ruby |
class SolicitudesController < ApplicationController
#MODULE: Utilitarios
# GET /solicitudes
# GET /solicitudes.xml
def index
@solicitudes = Solicitud.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @solicitudes }
end
end
# GET /solicitudes/... | Ruby |
class UniformesController < ApplicationController
#MODULE: Uniformes
# GET /uniformes
# GET /uniformes.xml
def index
@uniformes = Uniforme.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @uniformes }
end
end
# GET /uniformes/1
# GET /uniformes... | Ruby |
class HobbiesController < ApplicationController
#MODULE: Configuraciones
# GET /hobbies
# GET /hobbies.xml
def index #DESC: Listar los hobbies
@hobbies = Hobbie.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @hobbies }
end
end
# GET /hobbies/... | Ruby |
class ParametrosController < ApplicationController
#MODULE: Configuraciones
# GET /parametros
# GET /parametros.xml
def index
@parametros = Parametro.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @parametros }
end
end
# GET /parametros/1
# ... | Ruby |
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# i... | Ruby |
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying do debug a probl... | Ruby |
# Be sure to restart your server when you modify this file.
# These settings change the behavior of Rails 2 apps and will be defaults
# for Rails 3. You can remove this initializer when Rails 3 is released.
if defined?(ActiveRecord)
# Include Active Record class name as root for JSON serialized output.
ActiveReco... | Ruby |
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Components used by the form builder to generate a complete input. You can
# remove any of them, change the order, or even add your own components in the
# stack. By inheriting your component from SimpleForm::C... | Ruby |
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
Mime::Type.register_alias "text/html", :combo
Mime::Type.register "application/vnd.ms-excel", :xls
| Ruby |
# Be sure to restart your server when you modify this file.
# Your secret key for verifying cookie session data integrity.
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Act... | Ruby |
# Override the string_to_date method in class Column
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%d/%m/%Y')
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(:default => '%d/%m/%Y %H:%M')
class ActiveRecord::ConnectionAdapters::Column
def self.string_to_date(... | Ruby |
APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/settings.yml")[RAILS_ENV].symbolize_keys
#Fix CSS de errores
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
msg = instance.error_message
error_style = "background-color: #f2afaf"
if html_tag =~ /<(input|textarea|select)[^>]+style=/
style... | Ruby |
ActionController::Routing::Routes.draw do |map|
map.resources :premiaciones_escalas
map.resources :factores_reconocimientos
map.resources :capacitaciones_evaluaciones
map.resources :escalas
map.resources :capacitaciones_procesos
map.resources :capacitaciones_areas_conocimientos do |cac|
cac.r... | Ruby |
# Don't change this file!
# Configure your app in config/environment.rb and config/environments/*.rb
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
module Rails
class << self
def boot!
unless booted?
preinitialize
pick_boot.run
end
end
def booted?
... | Ruby |
# Use this file to easily define all of your cron jobs.
#
# It's helpful, but not entirely necessary to understand cron before proceeding.
# http://en.wikipedia.org/wiki/Cron
# Example:
#
# set :output, "/path/to/my/cron_log.log"
#
# every 2.hours do
# command "/usr/bin/some_great_command"
# runner "MyModel.some_m... | Ruby |
# -*- coding: utf-8 -*-
{
:'es-AR' => {
:authlogic => {
:error_messages => {
:email_invalid => "deberia parecer una direccion email."
}
},
:years => "años",
:months => "meses",
:weeks => "semanas",
:days => "dias",
:hours => "horas",
:minutes =... | Ruby |
# Be sure to restart your server when you modify this file
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.action_controller.consider_all_reque... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.ca... | Ruby |
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between... | Ruby |
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
| Ruby |
module Jqgrid
def find_by_params(params, opts)
clase = opts[:class]
page = params[:page] ? (params[:page]).to_i : 1
rp = params[:rows] ? (params[:rows]).to_i : 10
sortname = params[:sidx]
sortorder = params[:sord] ? params[:sord] : "desc"
tipo = opts[:tipo_join] ? opts[:tipo_join] : :joi... | Ruby |
namespace :fix do
desc "Recolecta todas las preguntas de la evaluacion 360 con id 4\n
y las agrupa por el metodo 'all_data'; que contiene todos los valores relevantes de la pregunta;\n
por cada par de preguntas duplicadas, busca las respuestas y las agrupa por el metodo usuario_y_evaluado\n
Asi tenemos l... | Ruby |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.