Sha256: fd511ae55bff4c69a3f9fef37d86f70e4a26c65eef7f2be017fc7877f945bfaa
Contents?: true
Size: 761 Bytes
Versions: 10
Compression:
Stored size: 761 Bytes
Contents
class Lookups::<%=class_name.pluralize %>Controller < ApplicationController #created by <%=ENV['SUDO_USER']||ENV['USERNAME']%> at <%=Time.now.strftime('%d/%m/%Y %H:%M')%> # GET <%= route_url %> # GET <%= route_url %>.xml def index <% colunas_like = colunas.dup colunas_param = colunas.dup colunas_like.collect! {|x| "("+x+" like ?)"} colunas_param.collect! {|y| '"%"<<params[:search].to_s<<"%"'} %> @<%= plural_table_name %> = <%= class_name%>.paginate(:page => params[:page], :per_page => 25,:conditions=>["<%= colunas_like.join(' or ') %>",<%=colunas_param.join(',')%>]) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @<%= plural_table_name %> } end end end
Version data entries
10 entries across 10 versions & 1 rubygems