A Rails Engine for organizing Kendo tournaments.
-
postgres is the only db type supported yet
rails new your_app_name -d postgresql --skip-test-unit -B
In your Gemfile:
gem "kendocup", github: "yannis/kendocup"
and bundle install
In your routes.rb
scope ":locale", locale: /fr|en/ do |locale|
mount Kendocup::Engine => "/"
root to: redirect("/#{I18n.locale}/cups")
end
get '/', to: redirect(I18n.locale.to_s)
ActiveAdmin.routes(self)
In application.rb after require "sprockets/railtie"
add
require "prawn"
require "prawn/table"
require "omniauth"
require "omniauth-facebook"
require "activeadmin"
require "figaro"
and right before closing class Application < Rails::Application
add
config.action_mailer.default_url_options = { only_path: true }
You will change this settings once your email settings are available.
In db/seeds.rb add
Kendocup::Engine.load_seed
Copy Kendocup db migrations to your app db/migrate directory
bin/rake kendocup:install:migrations
bin/rake db:create
and migrate
bin/rake db:migrate
fill db with seed data
bin/rake db:seed
Restart your rails server and try to sign in by opening /en/users/sign_in
- email: admin@kendocup.com
- password: adminuser
and now go to /admin
you should be in activeadmin