-
Add
gem 'bootstrap'
to your gemfile. -
Add
gem 'jquery-rails'
to your gemfile. -
rename the
application.css
file to application.scss (located in app/assets/stylesheets/application.css) -
Add '@import "bootstrap";` to your application.scss file
-
Add to your application.js file. ( located at app/assets/javascripts/application.js)
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/dwyn/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
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
$ ps ax | grep shotgun | |
11152 s000 R+ 0:00.00 grep shotgun | |
10766 s001 S+ 0:00.60 /Users/ryandeussing/.rvm/gems/ruby-1.9.3-p429@sinatra/bin/shotgun | |
$ kill -9 10766 | |
#done |
Specs:
- Using Ruby on Rails for the project
- Include at least one has_many relationship (x has_many y; e.g. User has_many Recipes)
- Include at least one belongs_to relationship (x belongs_to y; e.g. Post belongs_to User)
- Include at least two has_many through relationships (x has_many y through z; e.g. Recipe has_many Items through Ingredients)
- Include at least one many-to-many relationship (x has_many y through z, y has_many x through z; e.g. Recipe has_many Items through Ingredients, Item has_many Recipes through Ingredients)
- The "through" part of the has_many through includes at least one user submittable attribute, that is to say, some attribute other than its foreign keys that can be submitted by the app's user (attribute_name e.g. ingredients.quantity)
- Include reasonable validations for simple model objects (list of model objects with validations e.g. User, Recipe, Ingredient, Item)
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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/Users/dharmon/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
You must be running Windows 10 to perform this procedure. If you are using a different operating system, check When should I set up a local environment to find out what setup instructions you should follow.
Note: It is no longer necessary to enable developer mode for Windows Subsystem Linux to work.
- Windows Subsystem Linux (WSL) is not automatically enabled on windows. So, to start off, we need to enable it!
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
def some_method | |
This is what I would do here | |
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
{ | |
// Editor | |
// When enabled, the diff editor ignores changes in leading or trailing whitespace. | |
"diffEditor.ignoreTrimWhitespace": true, | |
// Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout. | |
"diffEditor.maxComputationTime": 5000, | |
// Controls whether the diff editor shows +/- indicators for added/removed changes. |
You could have a few options. The possiblities are (as usual) endless with Ruby.
This is something I whipped up really quickly. I dont love it, but I think it works.
app/models/cafe.rb
scope :open_cafes, -> {
today = Date.today.strftime("%A").downcase
joins(:openings).where("day = ? AND status = 'open'", today)
OlderNewer