Skip to content

Instantly share code, notes, and snippets.

@kimenye
Last active December 28, 2015 20:59
Show Gist options
  • Save kimenye/7561890 to your computer and use it in GitHub Desktop.
Save kimenye/7561890 to your computer and use it in GitHub Desktop.
Creating the NDS library application
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
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
rails g model Author name:string country:string bio:text
rails g model Book title:string description:text author:references
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