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 SearchController < ApplicationController | |
before_action :set_search_option, only: [:index] | |
# Query the product model and return all indexed items. | |
def index | |
@product_results = ProductsIndex.aggregations(search_aggregations) | |
apply_filters(@search_options[:search_with]).each { |filter| @product_results = @product_results.merge(filter) } | |
# Apply any facet filters already selected | |
if @search_term.present? |
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
<h4><%= @product[0].quote.category.name.titleize if @product.present? %> Products</h4> | |
<% if @product.present? %> | |
<%= render partial: '/products/listings', locals: { product: @product } %> | |
<% else %> | |
<p>The are no agape love quotes</p> | |
<%= render partial: '/products/no_product' %> | |
<% 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
DASH | |
------ | |
:Dash[!] | |
:Dash printf | |
:Dash setTimeout javascript | |
:Dash! | |
:Dash! func #Will search for 'func' in all docsets. | |
:DashKeywords | |
:DashKeywords backbone underscore javascript |
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
rake test TEST=test/models/admin_ability_test.rb |
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
CTRL Ww moves you from window to window ( | |
CTRL WT moves current window into a tab | |
t (While in nerdtree) opens the file in a tab. | |
gt Goes to next tab. | |
gT Goes to previous tab. | |
\n Toggles the NerdTree on or off. | |
Command T - find in project. |
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
new_record? | |
any? | |
kind_of? | |
include? | |
nil? | |
blank? | |
clear? | |
empty? |
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
ActiveRecord | |
----------- | |
SERIALIZED ATTRIBUTE | |
$ rails c --sandbox or rails c development | |
#create class method | |
$ user = User.create( name" "albert", email: "[email protected]" ) | |
#new class method |
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
$ IRB ****Let you into Ruby Interpreter | |
1.9.3-p194 :088 > use TAB key to autocomplete. | |
1.9.3-p194 :089 > help | |
Enter the method name you want to look up. | |
You can use tab to autocomplete. | |
Enter a blank line to exit. |
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
cd into directory of the Ruby.rb file... | |
it-macbook-albert:karoake albertmckeever$ IRB | |
1.9.3-p194 :001 > load 'song.rb' | |
=> true |
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
Esc shft + b - moves cursor(c) BACK to begin of a text. eg. (c)albert (c)mckeever (c)help | |
Esc shft+ f moves cursor(c) FORWARD to begin of a text. eg. (c)albert (c)mckeever (c)help | |
shft + cmd - selects all | |
Ctrl+A and Ctrl+E - home and end | |
Ctrl+U: This clears the entire line so you can type in a completely new command. | |
Ctrl+K: This deletes the line from the position of the cursor to the end of the line. | |
Ctrl+W: This deletes the word before the cursor only. | |
Ctrl+R: This lets you search your command history for something specific. | |
Tab: autocomplete |
NewerOlder