Sha256: 9b818ad0d85c7e58eddf7a8ca8d205c610d522559f856c7f67ee97724f1799f8

Contents?: true

Size: 1.56 KB

Versions: 15

Compression:

Stored size: 1.56 KB

Contents

# require 'rails/all'
require 'action_controller/railtie'
require 'action_view/railtie'

require 'fake_app/active_record/config' if defined? ActiveRecord
require 'fake_app/data_mapper/config' if defined? DataMapper
require 'fake_app/mongoid/config' if defined? Mongoid
require 'fake_app/mongo_mapper/config' if defined? MongoMapper
# config
app = Class.new(Rails::Application)
app.config.secret_token = '3b7cd727ee24e8444053437c36cc66c4'
app.config.session_store :cookie_store, :key => '_myapp_session'
app.config.active_support.deprecation = :log
app.config.eager_load = false
# Rais.root
app.config.root = File.dirname(__FILE__)
Rails.backtrace_cleaner.remove_silencers!
app.initialize!

# routes
app.routes.draw do
  resources :users
end

#models
require 'fake_app/active_record/models' if defined? ActiveRecord
require 'fake_app/data_mapper/models' if defined? DataMapper
require 'fake_app/mongoid/models' if defined? Mongoid
require 'fake_app/mongo_mapper/models' if defined? MongoMapper

# controllers
class ApplicationController < ActionController::Base; end
class UsersController < ApplicationController
  def index
    @users = User.page params[:page]
    render :inline => <<-ERB
<%= @users.map(&:name).join("\n") %>
<%= paginate @users %>
ERB
  end
end

if defined? ActiveRecord
  class AddressesController < ApplicationController
    def index
      @addresses = User::Address.page params[:page]
      render :inline => <<-ERB
  <%= @addresses.map(&:street).join("\n") %>
  <%= paginate @addresses %>
  ERB
    end
  end
end

# helpers
Object.const_set(:ApplicationHelper, Module.new)

Version data entries

15 entries across 15 versions & 7 rubygems

Version Path
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/kaminari-0.17.0/spec/fake_app/rails_app.rb
kaminari-0.17.0 spec/fake_app/rails_app.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/kaminari-0.16.3/spec/fake_app/rails_app.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/kaminari-0.16.3/spec/fake_app/rails_app.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/kaminari-0.16.3/spec/fake_app/rails_app.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/kaminari-0.16.3/spec/fake_app/rails_app.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/kaminari-0.16.3/spec/fake_app/rails_app.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/kaminari-0.16.3/spec/fake_app/rails_app.rb
kaminari-0.16.3 spec/fake_app/rails_app.rb
kaminari-0.16.2 spec/fake_app/rails_app.rb
kaminari-0.16.1 spec/fake_app/rails_app.rb
kaminari-0.16.0 spec/fake_app/rails_app.rb
kaminari-0.15.1 spec/fake_app/rails_app.rb
kaminari-0.15.0 spec/fake_app/rails_app.rb
kaminari-rails4-0.15.0 spec/fake_app/rails_app.rb