-
Install Ruby via RailsInstaller (install latest version)
-
bundle install --without production
-
Install the rerun gem:
gem install rerun
-
rerun 'bundle exec ruby app.rb'
-
Authentication System: "/login", "/logout", "/sign_up"
-
User model
-
Bootstrap
I have created a helper method authenticate!
which, when called, will redirect the user to the sign in page if they are not signed in. This will help you protect pages that should only be accessed by signed in users.
To define a URL in which the person must be signed in to view, use the authenticate!
method.
For example:
get "/dashboard" do
authenticate!
erb :dashboard
end
To get information about the current signed in user, use the current_user
method which returns the user object of the current signed in user or nil
if no one is signed in.
In a template:
Hello <%= current_user.email %>
In code:
get '/say_hello' do
if current_user
return "Hello #{current_user.email}!"
else
return "Hello World!"
end
end
- Add all your changes on git and make a commit
- Create a Heroku server:
heroku create
- Create a database for your server:
heroku addons:create heroku-postgresql:hobby-dev
- Push the code to Heroku:
git push heroku master
- I preconfigured the necessary files for this to work.
- Verify all is working and submit your links (github and heroku) to me.