Upskill Software-as-a-Service Ruby on Rails App Building a website using ruby on rails
This command will only work from inside the Rails application directory.
###Terminal
cd workspace
rails s -b $IP -p $PORT
git add .
git commit -m "####"
git push origin ####
bundle exec rails server -b $IP -p $PORT
(The shorthand version of the command is...) bundle exec rails s -b $IP -p $PORT
##link_to Used ruby prefixes <%= link_to , %> <%= link_to "About", about_path %>
##routes use prefixes instead of hard-coding links ###Terminal rails routes routes call the controller page > #name
##PagesController controller use the #name from routes to run (def #name) to look for the app views
##app>views>pages
rails db:drop
rails db:migrate
##db/seeds.rb database table to store membership plan offerings.
##Git notes
Go back to a previous branch. First stash away any uncommitted changes otherwise Git will complain:
git stash
Then, simply check out an older branch that you know has the correct, working code. It could be the master branch, or some other branch like contact_form, etc. (replace previous_branch_name below with whichever branch you want to switch to):
git checkout previous_branch_name
Delete the branch with the broken code to keep things organized:
git branch -D broken_branch
Then checkout a new branch, and name it whatever is relevant:
git checkout -b new_branch_name
Now, you're basically back to the point where the app was working before in a previous branch's state.
##Reset to a working branch.
Another, more direct workflow is to use Git's reset feature.
git stash
The following command will reset your current branch to whichever branch you specify after the "/". You can put any other branch name in there, but in this example, your code would end up matching whatever was most recently pushed to the master branch:
git reset --hard origin/master
git checkout master
git branch
git merge contact_form
git push origin master
git push heroku master
heroku run rails db:migrate
heroku run rails db:migrate