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
| show.html.slim | |
| - @post.comments.each do |comment| | |
| div.comment | |
| # Works and shows user attributes | |
| / --- !ruby/object:User | |
| / aggregation_cache: {} | |
| / | |
| / association_cache: {} |
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>Action Controller: Exception caught</title> | |
| <style> | |
| body { background-color: #fff; color: #333; } | |
| body, p, ol, ul, td { |
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
| if cookies[:post_view][@post.id].blank? | |
| cookies[:post_view][@post.id] = true | |
| @post.increment!(:view_count) | |
| 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
| shopping_cart.values.reduce(:+) * 24.99 |
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-US" ng-app="Site"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Angular.js Tutorial</title> | |
| <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet"> | |
| <style type="text/css"> | |
| body { | |
| padding-top:60px; | |
| } |
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
| @font-face { | |
| font-family: 'FontAwesome'; | |
| src: url('../font/fontawesome-webfont.eot'); | |
| src: url('../font/fontawesome-webfont.eot?#iefix') format('embedded-opentype'), url('../font/fontawesome-webfont.woff') format('woff'), url('../font/fontawesome-webfont.ttf') format('truetype'), url('../font/fontawesome-webfont.svg#FontAwesome') format('svg'); | |
| font-weight: normal; | |
| font-style: normal; | |
| } |
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
| # Tabs | |
| $('.tab').on 'click', -> | |
| $('.tab').removeClass('active') | |
| $(this).addClass('active') | |
| opens = $(this).data('opens') | |
| $('.tab-content').hide() | |
| $(".tab-content[data-id='#{opens}']").show() |
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
| ( ! ) A fatal error has occurred. Please see the Default.log file for 2013-01-08. Request ID: a8c8ed | |
| Programmer Error: Uncaught exception of type "ErrorException" | |
| Application: Client | |
| InterfaceBundle: Default | |
| Request URI: /files/font/fontawesome-webfont.svg | |
| Redirect Query String: eg_requestClass=file&eg_requestID=rawfile&file_name=font/fontawesome-webfont.svg | |
| Request URL: http://petflow3.site/files/font/fontawesome-webfont.svg |
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
| protected function resolveAction ($action, $method = 'GET') { | |
| $this->action = $action; | |
| parent::resolveAction($action, $method); | |
| } | |
| public function before () { | |
| if ($this->action == 'your_action_here') { | |
| // do stuff | |
| } else { | |
| // do other stuff |
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
| class User < ActiveRecord::Base | |
| attr_accessible :email, :first_name, :last_name | |
| has_one :shopping_cart | |
| has_and_belongs_to_many :addresses | |
| has_and_belongs_to_many :payment_options | |
| validates :email, uniqueness: true, presence: true, format: { with: /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i } | |
| has_secure_password | |
| def self.authenticate(email, password) |
OlderNewer