Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OUTPUT_FILE: agility.markdown ## Before you start You'll need a working Ruby on Rails setup. We're assuming you know at least the basics of Rails. If not, you should probably work through a Rails tutorial before attempting this one. ## Create the application with Hobo gem Although Hobo is in fact a group of Rails plugins, it is also available as a gem which gives you the useful `hobo` command: $ gem install hobo --pre The `hobo` command is like the `rails` command, it can create a new blank Rails app that is set-up for Hobo, as well as performing several other tasks. When you run the command, it will ask you many questions. For now, answer exactly as we do. $ hobo new agility Hobo Command Line Interface 2.0.0.pre8 Generating Rails infrastructure... create create README.rdoc create Rakefile ... snip ... Hobo Setup Wizard Do you want to start the Setup Wizard now? (Choose 'n' if you need to manually customize any file before running the Wizard. You can run it later with `hobo g setup_wizard` from the application root dir.) [y|n] Choose yes here to pull in Hobo. User Resource Choose a name for the user resource: [<enter>=user|<custom_name>] Press enter to leave the name of the user model as `user`. Do you want to send an activation email to activate the user? [y|n] y Press `y` here because that's a useful feature we'll use. Invite Only Option Do you want to add the features for an invite only website? [y|n] n We're not building an invite-only website, so we'll press `n` here. Templates Option Will your application use only hobo/dryml web page templates? (Choose 'n' only if you also plan to use plain rails/erb web page templates) [y|n] y Press `y` here because we're building a pure Hobo application. Test Framework Do you want to customize the test_framework? [y|n] n Choose no -- we'll use the default test framework, Test::Unit. It's easy enough to select a different test framework later if you change your mind. Front Controller Choose a name for the front controller: [<enter>=front|<custom_name>] Press enter to leave the default front controller name as `front`. Front Theme The currently available themes are clean, clean_admin, clean_sidemenu and bootstrap. Choose a theme for the front site: [<enter>=bootstrap|<custom_name>] Press enter to choose the default Hobo theme, bootstrap. Front jQuery-UI Theme The currently available jQuery-UI themes are listed here: https://github.com/fatdude/jquery-ui-themes-rails/blob/master/README.markdown Choose a jQuery-UI theme for the front site: [<enter>=redmond|<custom_name>] Press enter to select the default jQuery-UI theme, redmond. jQuery-UI is not used very much with the bootstrap theme and may be [removed later](http://hobocentral.net/blog/2012/12/21/using-hobo-2-0-without-jquery-ui/). Admin Subsite Do you want an admin subsite? [y|n] n A subsite in Hobo is a separate collection of views and controllers routed independently. Each subsite can have a different theme. They're easy enough to add later via the [admin_subsite](/manual/generators/admin_subsite) or [subsite](/manual/generators/subsite) generators so we won't add one now. DB Migration Initial Migration: [s]kip, [g]enerate migration file only, generate and [m]igrate: [s|g|m] m Press `m` here. There's a lot going on underneath the hood here, but we'll get to that later. I18n The Hobo supported locales are de en es fr it nb pt-PT ru (please, contribute to more translations) Type the locales (space separated) you want to add to your application or <enter> for 'en': Press enter here to choose English. => "en" Git Repository Do you want to initialize a git repository now? [y|n] y Do you want git to ignore the auto-generated files? (Choose 'n' only if you are planning to deploy on a read-only File System like Heroku) [y|n] y Choose `y` to both of these questions to put your project into Git. Even if you don't know git you can still say "yes" here -- maybe you'll find it useful in the future. ## Run the app You should now have a complete bare bones application. Fire it up and give it a try! $ cd agility $ rails server
- Loading branch information
1 parent
5928b5e
commit 6c148d3
Showing
75 changed files
with
1,344 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
# | ||
# If you find yourself ignoring temporary files generated by your text editor | ||
# or operating system, you probably want to add a global ignore instead: | ||
# git config --global core.excludesfile ~/.gitignore_global | ||
|
||
# Ignore bundler config | ||
/.bundle | ||
|
||
# Ignore the default SQLite database. | ||
/db/*.sqlite3 | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
app/views/taglibs/auto/**/* | ||
config/hobo_routes.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'rails', '3.2.11' | ||
|
||
# Bundle edge Rails instead: | ||
# gem 'rails', :git => 'git://github.com/rails/rails.git' | ||
|
||
gem 'sqlite3' | ||
|
||
|
||
# Gems used only for assets and not required | ||
# in production environments by default. | ||
group :assets do | ||
gem 'sass-rails', '~> 3.2.3' | ||
gem 'coffee-rails', '~> 3.2.1' | ||
|
||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes | ||
# gem 'therubyracer', :platforms => :ruby | ||
|
||
gem 'uglifier', '>= 1.0.3' | ||
end | ||
|
||
gem 'jquery-rails' | ||
|
||
# To use ActiveModel has_secure_password | ||
# gem 'bcrypt-ruby', '~> 3.0.0' | ||
|
||
# To use Jbuilder templates for JSON | ||
# gem 'jbuilder' | ||
|
||
# Use unicorn as the app server | ||
# gem 'unicorn' | ||
|
||
# Deploy with Capistrano | ||
# gem 'capistrano' | ||
|
||
# To use debugger | ||
# gem 'debugger' | ||
|
||
gem "hobo", "= 2.0.0.pre8" | ||
# Hobo has a lot of assets. Stop cluttering the log in development mode. | ||
gem "quiet_assets", :group => :development | ||
# Hobo's version of will_paginate is required. | ||
gem "will_paginate", :git => "git://github.com/Hobo/will_paginate.git" | ||
gem "hobo_bootstrap", "2.0.0.pre8" | ||
gem "hobo_jquery_ui", "2.0.0.pre8" | ||
gem "hobo_bootstrap_ui", "2.0.0.pre8" | ||
gem "jquery-ui-themes", "~> 0.0.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
GIT | ||
remote: git://github.com/Hobo/will_paginate.git | ||
revision: cc7ef01551b94fe4f607e38929037234dc70bb62 | ||
specs: | ||
will_paginate (3.0.4.hobo) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actionmailer (3.2.11) | ||
actionpack (= 3.2.11) | ||
mail (~> 2.4.4) | ||
actionpack (3.2.11) | ||
activemodel (= 3.2.11) | ||
activesupport (= 3.2.11) | ||
builder (~> 3.0.0) | ||
erubis (~> 2.7.0) | ||
journey (~> 1.0.4) | ||
rack (~> 1.4.0) | ||
rack-cache (~> 1.2) | ||
rack-test (~> 0.6.1) | ||
sprockets (~> 2.2.1) | ||
activemodel (3.2.11) | ||
activesupport (= 3.2.11) | ||
builder (~> 3.0.0) | ||
activerecord (3.2.11) | ||
activemodel (= 3.2.11) | ||
activesupport (= 3.2.11) | ||
arel (~> 3.0.2) | ||
tzinfo (~> 0.3.29) | ||
activeresource (3.2.11) | ||
activemodel (= 3.2.11) | ||
activesupport (= 3.2.11) | ||
activesupport (3.2.11) | ||
i18n (~> 0.6) | ||
multi_json (~> 1.0) | ||
arel (3.0.2) | ||
bootstrap-datepicker-rails (0.6.35) | ||
railties (>= 3.0) | ||
bootstrap-sass (2.2.2.0) | ||
sass (~> 3.2) | ||
builder (3.0.4) | ||
coffee-rails (3.2.2) | ||
coffee-script (>= 2.2.0) | ||
railties (~> 3.2.0) | ||
coffee-script (2.2.0) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.4.0) | ||
dryml (2.0.0.pre8) | ||
actionpack (~> 3.2.0) | ||
hobo_support (= 2.0.0.pre8) | ||
erubis (2.7.0) | ||
execjs (1.4.0) | ||
multi_json (~> 1.0) | ||
hike (1.2.1) | ||
hobo (2.0.0.pre8) | ||
dryml (= 2.0.0.pre8) | ||
hobo_fields (= 2.0.0.pre8) | ||
hobo_support (= 2.0.0.pre8) | ||
will_paginate (~> 3.0.0) | ||
hobo_bootstrap (2.0.0.pre8) | ||
bootstrap-sass (~> 2.1) | ||
hobo (~> 2.0.0.pre6) | ||
hobo_jquery (~> 2.0.0.pre6) | ||
will_paginate-bootstrap (~> 0.2.1) | ||
hobo_bootstrap_ui (2.0.0.pre8) | ||
bootstrap-datepicker-rails | ||
hobo_bootstrap (~> 2.0.0.pre1) | ||
hobo_fields (2.0.0.pre8) | ||
hobo_support (= 2.0.0.pre8) | ||
hobo_jquery (2.0.0.pre8) | ||
hobo_rapid (= 2.0.0.pre8) | ||
jquery-rails (~> 2.0) | ||
hobo_jquery_ui (2.0.0.pre8) | ||
hobo (= 2.0.0.pre8) | ||
hobo_jquery (= 2.0.0.pre8) | ||
jquery-ui-themes (~> 0.0.4) | ||
hobo_rapid (2.0.0.pre8) | ||
hobo (= 2.0.0.pre8) | ||
hobo_support (2.0.0.pre8) | ||
rails (~> 3.2.0) | ||
httparty (0.9.0) | ||
multi_json (~> 1.0) | ||
multi_xml | ||
i18n (0.6.1) | ||
journey (1.0.4) | ||
jquery-rails (2.1.4) | ||
railties (>= 3.0, < 5.0) | ||
thor (>= 0.14, < 2.0) | ||
jquery-ui-themes (0.0.8) | ||
httparty | ||
json (1.7.6) | ||
mail (2.4.4) | ||
i18n (>= 0.4.0) | ||
mime-types (~> 1.16) | ||
treetop (~> 1.4.8) | ||
mime-types (1.19) | ||
multi_json (1.5.0) | ||
multi_xml (0.5.1) | ||
polyglot (0.3.3) | ||
quiet_assets (1.0.1) | ||
railties (~> 3.1) | ||
rack (1.4.3) | ||
rack-cache (1.2) | ||
rack (>= 0.4) | ||
rack-ssl (1.3.2) | ||
rack | ||
rack-test (0.6.2) | ||
rack (>= 1.0) | ||
rails (3.2.11) | ||
actionmailer (= 3.2.11) | ||
actionpack (= 3.2.11) | ||
activerecord (= 3.2.11) | ||
activeresource (= 3.2.11) | ||
activesupport (= 3.2.11) | ||
bundler (~> 1.0) | ||
railties (= 3.2.11) | ||
railties (3.2.11) | ||
actionpack (= 3.2.11) | ||
activesupport (= 3.2.11) | ||
rack-ssl (~> 1.3.2) | ||
rake (>= 0.8.7) | ||
rdoc (~> 3.4) | ||
thor (>= 0.14.6, < 2.0) | ||
rake (10.0.3) | ||
rdoc (3.12) | ||
json (~> 1.4) | ||
sass (3.2.5) | ||
sass-rails (3.2.5) | ||
railties (~> 3.2.0) | ||
sass (>= 3.1.10) | ||
tilt (~> 1.3) | ||
sprockets (2.2.2) | ||
hike (~> 1.2) | ||
multi_json (~> 1.0) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
sqlite3 (1.3.6) | ||
thor (0.16.0) | ||
tilt (1.3.3) | ||
treetop (1.4.12) | ||
polyglot | ||
polyglot (>= 0.3.1) | ||
tzinfo (0.3.35) | ||
uglifier (1.3.0) | ||
execjs (>= 0.3.0) | ||
multi_json (~> 1.0, >= 1.0.2) | ||
will_paginate-bootstrap (0.2.2) | ||
will_paginate (>= 3.0.3) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
coffee-rails (~> 3.2.1) | ||
hobo (= 2.0.0.pre8) | ||
hobo_bootstrap (= 2.0.0.pre8) | ||
hobo_bootstrap_ui (= 2.0.0.pre8) | ||
hobo_jquery_ui (= 2.0.0.pre8) | ||
jquery-rails | ||
jquery-ui-themes (~> 0.0.4) | ||
quiet_assets | ||
rails (= 3.2.11) | ||
sass-rails (~> 3.2.3) | ||
sqlite3 | ||
uglifier (>= 1.0.3) | ||
will_paginate! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env rake | ||
# 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.expand_path('../config/application', __FILE__) | ||
|
||
Agility::Application.load_tasks |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// This file is included in all sites and subsites. This is a | ||
// manifest file that'll be compiled into including all the files | ||
// listed below. Add new JavaScript/Coffee code in separate files in | ||
// the application directory and they'll automatically be included. | ||
// It's not advisable to add code directly here, but if you do, it'll | ||
// appear at the bottom of the the compiled file. | ||
// | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require jquery-ui | ||
//= require_tree ./application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// This is a manifest file that'll be compiled into application.js, which will include all the files | ||
// listed below. | ||
// | ||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | ||
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | ||
// | ||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | ||
// the compiled file. | ||
// | ||
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD | ||
// GO AFTER THE REQUIRES BELOW. | ||
// | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require_tree . |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// This is a manifest file for the front subsite (which is your whole | ||
// application if you don't have any subsites). It will be compiled | ||
// into including all the files listed below. Add new | ||
// JavaScript/Coffee code in separate files in the front directory and | ||
// they'll automatically be included in the compiled file accessible | ||
// from http://example.com/assets/front.js It's not advisable to add | ||
// code directly here, but if you do, it'll appear at the bottom of | ||
// the the compiled file. | ||
// | ||
//= require application | ||
//= require hobo_rapid | ||
//= require hobo_jquery | ||
//= require hobo_bootstrap | ||
//= require hobo_jquery_ui | ||
//= require hobo_bootstrap_ui | ||
//= require_tree ./front |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* This is a manifest file that'll be compiled into application.css, which will include all the files | ||
* listed below. | ||
* | ||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, | ||
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. | ||
* | ||
* You're free to add application-wide styles to this file and they'll appear at the top of the | ||
* compiled file, but it's generally better to create a new file per style scope. | ||
* | ||
*= require_self | ||
*= require_tree . | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* This is the global stylesheet manifest file. Files or plugins | ||
* referenced from here or placed in the application/ directory will be | ||
* included in all subsites. This file is included by front.css and all | ||
* subsites. | ||
* | ||
*= require_self | ||
*= require_tree ./application | ||
*/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* This is the stylesheet manifest file for the front subsite (which | ||
* is your whole application if you don't have any subsites). Files | ||
* or plugins referenced from here or placed in the front/ directory | ||
* will be included. | ||
* | ||
*= require_self | ||
*= require application | ||
*= require hobo_rapid | ||
*= require hobo_jquery | ||
*= require hobo_bootstrap | ||
*= require hobo_jquery_ui | ||
*= require hobo_bootstrap_ui | ||
*= require jquery-ui/redmond | ||
*= require_tree ./front | ||
*/ |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class ApplicationController < ActionController::Base | ||
protect_from_forgery | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class FrontController < ApplicationController | ||
|
||
hobo_controller | ||
|
||
def index; end | ||
|
||
def summary | ||
if !current_user.administrator? | ||
redirect_to user_login_path | ||
end | ||
end | ||
|
||
def search | ||
if params[:query] | ||
site_search(params[:query]) | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class UsersController < ApplicationController | ||
|
||
hobo_user_controller | ||
|
||
auto_actions :all, :except => [ :index, :new, :create ] | ||
|
||
# Normally, users should be created via the user lifecycle, except | ||
# for the initial user created via the form on the front screen on | ||
# first run. This method creates the initial user. | ||
def create | ||
hobo_create do | ||
if valid? | ||
self.current_user = this | ||
flash[:notice] = t("hobo.messages.you_are_site_admin", :default=>"You are now the site administrator") | ||
redirect_to home_page | ||
end | ||
end | ||
end | ||
|
||
end |
Oops, something went wrong.