This file contains hidden or 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
| <head> | |
| <title>meteor_servercall</title> | |
| </head> | |
| <body> | |
| {{> simple}} | |
| {{> passData}} | |
| </body> | |
| <template name="simple"> |
This file contains hidden or 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
| <% flash.each do |type, message| %> | |
| <div class="alert <%= bootstrap_class_for(type) %> fade in"> | |
| <button class="close" data-dismiss="alert">×</button> | |
| <%= message %> | |
| </div> | |
| <% end %> |
This file contains hidden or 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
| module ApplicationHelper | |
| def notice_message | |
| alert_types = { :notice => :success, :alert => :danger } | |
| close_button_options = { :class => "close", "data-dismiss" => "alert", "aria-hidden" => true } | |
| close_button = content_tag(:button, "×", close_button_options) | |
| alerts = flash.map do |type, message| | |
| alert_content = close_button + message | |
| alert_type = alert_types[type.to_sym] || type | |
| alert_class = "alert alert-#{alert_type} alert-dismissable" |
This file contains hidden or 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 require_user | |
| if !logged_in? | |
| flash[:error] = "You must log in to do that" | |
| redirect_to root_path | |
| end |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| </head> | |
| <body> | |
| <nav> | |
| <div class="container"> | |
| <ul class="navlist"> |
This file contains hidden or 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
| /*! normalize.css v2.1.3 | MIT License | git.io/normalize */ | |
| /* ========================================================================== | |
| HTML5 display definitions | |
| ========================================================================== */ | |
| /** | |
| * Correct `block` display not defined in IE 8/9. | |
| */ |
This file contains hidden or 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
| namespace :dev do | |
| desc "Generate fake data" | |
| task fakeup: ['db:schema:load', :environment] do | |
| 20.times do |i| | |
| Product.create( | |
| name: "product no.#{i}", description: "description no.#{i}", | |
| price: (rand(10) + 1) * 50, stock: rand(91) + 10 | |
| ) | |
| end | |
| cart = Cart.create |
This file contains hidden or 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
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
This file contains hidden or 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
| namespace :dev do | |
| desc "Generate fake data" | |
| task fakeup: ['db:schema:load', :environment] do | |
| 20.times do |i| | |
| Product.create( | |
| name: "product no.#{i}", description: "description no.#{i}", | |
| price: (rand(10) + 1) * 50, stock: rand(91) + 10 | |
| ) | |
| end | |
| cart = Cart.create |
OlderNewer