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
| NodeList.prototype.toArray = -> | |
| array = [] | |
| for obj, i in this | |
| array[i] = obj | |
| return array |
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
| # Place all the behaviors and hooks related to the matching controller here. | |
| # All this logic will automatically be available in application.js. | |
| # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script | |
| $.morpheus = require("morpheus") | |
| $.sugar = require("sugar") | |
| class PHIntroList | |
| setPageView: (pageviewEl) -> | |
| @pageView = pageviewEl |
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
| # All this logic will automatically be available in application.js. | |
| # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script | |
| $.morpheus = require("morpheus") | |
| $.sugar = require("sugar") | |
| highlightedItem = null | |
| intervalId = null | |
| class PHIntroList | |
| constructor: () -> |
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 Hash | |
| # Returns the value at the specified path. | |
| # For example, [:foo, :bar, :baz] as a path would return the | |
| # value at self[:foo][:bar][:baz]. If self doesn't contain one of | |
| # the keys specified in path, nil is returned. | |
| # | |
| # This method is useful as it simplifies statements such as: | |
| # value = h[:a][:b][:c][:d] if h[:a] && h[:a][:b] && h[:a][:b][:c] | |
| # to | |
| # value = h.value_at_path([:a, :b, :c, :d]) |
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 Object | |
| # Returns the value at the specified path. | |
| # For example, "foo.bar.baz" as a path would return the | |
| # value at self[:foo][:bar][:baz]. If self doesn't contain one of | |
| # the keys specified in path, It will return the farthest object found (will return self if it couldn't find anything). | |
| # | |
| # @param String keypath A path composed of keys separated with "." specifying a deep-nested path | |
| # @return Object the value object | |
| class Object |
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
| route.do | |
| resources :product do | |
| acl :anonymous do //guest access level | |
| get 'index', 'index.html.erb' | |
| end | |
| acl :user do | |
| get 'product/:id', 'product.html.erb' // Product.find_by_id(:id), redirect to 404 if cannot find object. By default @product is the object found. | |
| get 'product/:id/edit' do |
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
| <html> | |
| <head> | |
| <%= stylesheet_link_tag "application", controller_name, "template"%> | |
| <%= javascript_include_tag "application" , controller_name %> | |
| </head> | |
| </html> |
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 @GroupActionMenuHandler | |
| bind: -> | |
| $(document).on 'click', '.group-action-menu a', this.selectMenuItem | |
| selectMenuItem: (event) -> | |
| id = $(e.target).data('id') | |
| alert 'hello' | |
| false | |
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
| require 'test_helper' | |
| class SessionsControllerTest < ActionController::TestCase | |
| include Devise::TestHelpers | |
| def setup | |
| @new_user = users(:new_user) | |
| @active_user = users(:active_user) | |
| 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
| undefined method `client_contacts_path' for #<#<Class:0x007fb9f2606658>:0x007fb9f260afa0> | |
| rake routes: | |
| POST /client/:client_id/contact(.:format) contact#create | |
| Code: | |
| <div id="contact-form-modal" class="contact-form" title="Ajouter un contact"> | |
| <%= form_for [client, Contact.new] do %> | |
| <div class="row"> |