From d6b48962bb03a6de15366d50d986528f465c58e3 Mon Sep 17 00:00:00 2001 From: Daniel Kehoe Date: Wed, 26 Feb 2014 14:01:32 -0800 Subject: [PATCH] rails_apps_composer: add README files --- README | 62 +++++++++++- README.md | 140 ++++++++++++++++++++++++++++ README.rdoc | 28 ------ app/controllers/home_controller.rb | 2 + app/controllers/users_controller.rb | 32 +++++++ app/views/home/index.html.erb | 1 + app/views/users/edit.html.erb | 6 ++ app/views/users/index.html.erb | 8 ++ app/views/users/show.html.erb | 4 + config/routes.rb | 60 ++---------- public/humans.txt | 20 ++++ 11 files changed, 277 insertions(+), 86 deletions(-) create mode 100644 README.md delete mode 100644 README.rdoc create mode 100644 app/controllers/home_controller.rb create mode 100644 app/controllers/users_controller.rb create mode 100644 app/views/home/index.html.erb create mode 100644 app/views/users/edit.html.erb create mode 100644 app/views/users/index.html.erb create mode 100644 app/views/users/show.html.erb create mode 100644 public/humans.txt diff --git a/README b/README index e9a69fe..e533cb0 100644 --- a/README +++ b/README @@ -1,4 +1,58 @@ -RECIPES -["apps4", "controllers", "core", "email", "extras", "frontend", "gems", "git", "init", "models", "prelaunch", "railsapps", "readme", "routes", "saas", "setup", "testing", "views"] -PREFERENCES -{:git=>true, :apps4=>"rails-omniauth", :unit_test=>false, :integration=>false, :fixtures=>false, :email=>"none", :authentication=>"omniauth", :authorization=>"none", :starter_app=>false, :quiet_assets=>true, :local_env_file=>false, :better_errors=>true, :dev_webserver=>"webrick", :prod_webserver=>"same", :database=>"sqlite", :templates=>"erb", :continuous_testing=>"none", :frontend=>"simple", :omniauth_provider=>"twitter", :form_builder=>"none"} \ No newline at end of file +Rails Omniauth +======================== + +This application was generated with the rails_apps_composer gem: +https://github.com/RailsApps/rails_apps_composer +provided by the RailsApps Project: +http://railsapps.github.io/ + +________________________ + +Recipes: + +* apps4 +* controllers +* core +* email +* extras +* frontend +* gems +* git +* init +* models +* prelaunch +* railsapps +* readme +* routes +* saas +* setup +* testing +* views + +Preferences: + +* git: true +* apps4: rails-omniauth +* unit_test: false +* integration: false +* fixtures: false +* email: none +* authentication: omniauth +* authorization: none +* starter_app: false +* quiet_assets: true +* local_env_file: false +* better_errors: true +* dev_webserver: webrick +* prod_webserver: same +* database: sqlite +* templates: erb +* continuous_testing: none +* frontend: simple +* omniauth_provider: twitter +* form_builder: none +* rvmrc: true + +________________________ + +License diff --git a/README.md b/README.md new file mode 100644 index 0000000..f7d5fb4 --- /dev/null +++ b/README.md @@ -0,0 +1,140 @@ +Rails Omniauth +========= + +This application was generated with the [rails_apps_composer](https://github.com/RailsApps/rails_apps_composer) gem +provided by the [RailsApps Project](http://railsapps.github.io/). + +Diagnostics +- + +This application was built with recipes that are known to work together. + +This application was built with preferences that are NOT known to work +together. + +If the application doesn’t work as expected, please [report an issue](https://github.com/RailsApps/rails_apps_composer/issues) +and include these diagnostics: + +We’d also like to know if you’ve found combinations of recipes or +preferences that do work together. + +Recipes: + +* apps4 +* controllers +* core +* email +* extras +* frontend +* gems +* git +* init +* models +* prelaunch +* railsapps +* readme +* routes +* saas +* setup +* testing +* views + +Preferences: + +* git: true +* apps4: rails-omniauth +* unit_test: false +* integration: false +* fixtures: false +* email: none +* authentication: omniauth +* authorization: none +* starter_app: false +* quiet_assets: true +* local_env_file: false +* better_errors: true +* dev_webserver: webrick +* prod_webserver: same +* database: sqlite +* templates: erb +* continuous_testing: none +* frontend: simple +* omniauth_provider: twitter +* form_builder: none +* rvmrc: true + +Ruby on Rails +--- + +This application requires: + +- Ruby +- Rails + +Learn more about [Installing Rails](http://railsapps.github.io/installing-rails.html). + +Database +--- + +This application uses SQLite with ActiveRecord. + +Development +- + +- Template Engine: ERB +- Testing Framework: Test::Unit +- Front-end Framework: None +- Form Builder: None +- Authentication: OmniAuth +- Authorization: None +- Admin: None + + + + + + + delivery is disabled in development. + +Getting Started + + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + +Documentation and Support + + +This is the only documentation. + +#### Issues + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + +Similar Projects +- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + +Contributing +-- + +If you make improvements to this application, please share with others. + +- Fork the project on GitHub. +- Make your feature addition or bug fix. +- Commit with Git. +- Send the author a pull request. + +If you add functionality to this application, create an alternative +implementation, or build an application that is similar, please contact +me and I’ll add a note to the README so that others can find your work. + +Credits +-- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. + +License +-- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. diff --git a/README.rdoc b/README.rdoc deleted file mode 100644 index dd4e97e..0000000 --- a/README.rdoc +++ /dev/null @@ -1,28 +0,0 @@ -== README - -This README would normally document whatever steps are necessary to get the -application up and running. - -Things you may want to cover: - -* Ruby version - -* System dependencies - -* Configuration - -* Database creation - -* Database initialization - -* How to run the test suite - -* Services (job queues, cache servers, search engines, etc.) - -* Deployment instructions - -* ... - - -Please feel free to use a different markup language if you do not plan to run -rake doc:app. diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..fc0b474 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,2 @@ +class HomeController < ApplicationController +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb new file mode 100644 index 0000000..c6b110e --- /dev/null +++ b/app/controllers/users_controller.rb @@ -0,0 +1,32 @@ +class UsersController < ApplicationController + before_filter :authenticate_user! + before_filter :correct_user?, :except => [:index] + + def index + @users = User.all + end + + def edit + @user = User.find(params[:id]) + end + + def update + @user = User.find(params[:id]) + if @user.update_attributes(secure_params) + redirect_to @user + else + render :edit + end + end + + def show + @user = User.find(params[:id]) + end + + private + + def secure_params + params.require(:user).permit(:email) + end + +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..00bb3a7 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1 @@ +

Home

diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb new file mode 100644 index 0000000..89527b7 --- /dev/null +++ b/app/views/users/edit.html.erb @@ -0,0 +1,6 @@ +<%= form_for(@user) do |f| %> + <%= f.label :email %> + <%= f.text_field :email %> +
+ <%= f.submit "Update" %> +<% end %> diff --git a/app/views/users/index.html.erb b/app/views/users/index.html.erb new file mode 100644 index 0000000..351b7e7 --- /dev/null +++ b/app/views/users/index.html.erb @@ -0,0 +1,8 @@ +

Users

+ diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb new file mode 100644 index 0000000..1b9f09c --- /dev/null +++ b/app/views/users/show.html.erb @@ -0,0 +1,4 @@ +

User

+

User: <%= @user.name %>

+

Email: <%= @user.email if @user.email %>

+<%= link_to 'Edit account', edit_user_path %> diff --git a/config/routes.rb b/config/routes.rb index a4449d1..9d4aa79 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,56 +1,8 @@ RailsOmniauth::Application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + root :to => "home#index" + resources :users, :only => [:index, :show, :edit, :update ] + get '/auth/:provider/callback' => 'sessions#create' + get '/signin' => 'sessions#new', :as => :signin + get '/signout' => 'sessions#destroy', :as => :signout + get '/auth/failure' => 'sessions#failure' end diff --git a/public/humans.txt b/public/humans.txt new file mode 100644 index 0000000..a61e1c2 --- /dev/null +++ b/public/humans.txt @@ -0,0 +1,20 @@ +/* the humans responsible & colophon */ +/* humanstxt.org */ + + +/* TEAM */ + : + Site: + Twitter: + Location: + +/* THANKS */ + Daniel Kehoe (@rails_apps) for the RailsApps project + +/* SITE */ + Standards: HTML5, CSS3 + Components: jQuery + Software: Ruby on Rails + +/* GENERATED BY */ +RailsApps application template: http://railsapps.github.io/