Last active
December 28, 2015 20:59
-
-
Save kimenye/7561890 to your computer and use it in GitHub Desktop.
Creating the NDS library 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
rails new nds-library -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb | |
#If you have a problem make sure you have the latest rvm | |
http://railsapps.github.io/openssl-certificate-verify-failed.html |
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
require_dependency 'name_service' | |
class HomeController < ApplicationController | |
def index | |
binding.pry | |
if user_signed_in? | |
name = current_user.email | |
ns = NameService.new | |
@my_name = ns.my_name_is name | |
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
rails g model Author name:string country:string bio:text | |
rails g model Book title:string description:text author:references |
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
class NameService | |
def my_name_is name | |
"My name is #{name}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment