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
Rails.application.routes.draw do | |
resource :billing, controller: 'sjabloon/billing', only: [:create, :update, :destroy] do | |
member do | |
get 'setup', to: 'sjabloon/billing#new', as: 'new' | |
get '/', to: 'sjabloon/billing#show' | |
end | |
resources :plans, controller: 'sjabloon/plans', only: [:index, :update] | |
end | |
resource :card, controller: 'sjabloon/card', only: [:update] |
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
rails generate model Announcement account:references title body:text show_site_wide announcement_type target published_at:datetime | |
/Users/dan/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/route_set.rb:581:in `add_route': Invalid route name, already in use: 'root' | |
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explai | |
ned here: | |
https://guides.rubyonrails.org/routing.html#restricting-the-routes-created (ArgumentError) | |
from /Users/dan/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/mapper.rb:1957:in `add_route' | |
from /Users/dan/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/actionpack-6.0.0/lib/action_dispatch/routing/mapper.rb:1928:in `decomposed_match' | |
from /Users/dan/.rbenv/versions/2.6.4/lib/ruby/gems/2.6.0/gems/act |
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
import Ember from 'ember'; | |
import MixinOne from '../mixins/one'; | |
import MixinTwo from '../mixins/two'; | |
const { | |
on, | |
RSVP | |
} = Ember; | |
export default Ember.Controller.extend(MixinOne, MixinTwo, { |
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
import Ember from 'ember'; | |
import AuthenticatedRoute from 'dashboard/routes/authenticated'; | |
import DateRangedMixin from 'dashboard/routes/mixins/date-ranged'; | |
import ChartMixin from 'dashboard/routes/mixins/chart'; | |
export default AuthenticatedRoute.extend(DateRangedMixin, ChartMixin, { | |
model: function(options) { | |
var _this = this; | |
return this.store.findQueryOne( |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# EditorConfig helps developers define and maintain consistent | |
# coding styles between different editors and IDEs | |
# editorconfig.org | |
root = true | |
[*] | |
end_of_line = lf | |
charset = utf-8 | |
trim_trailing_whitespace = 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
.flip-switch { | |
position: relative; width: 68px; | |
-webkit-user-select:none; -moz-user-select:none; -ms-user-select: none; | |
} | |
.flip-switch-checkbox { | |
display: none; | |
} | |
.flip-switch-label { | |
display: block; overflow: hidden; cursor: pointer; | |
border: 2px solid #999999; border-radius: 20px; |
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
# Resources App | |
app_resources = Dragonfly[:resources] | |
app_resources.configure_with(:rails) do |c| | |
c.datastore.root_path = Rails.root.join('public', 'system', 'resources').to_s | |
# This url_format makes it so that dragonfly urls work in traditional | |
# situations where the filename and extension are required, e.g. lightbox. | |
# What this does is takes the url that is about to be produced e.g. | |
# /system/resources/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw | |
# and adds the filename onto the end (say the file was 'refinery_is_awesome.pdf') | |
# /system/resources/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.pdf |
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
<?php | |
function render_template($filename, $locals=array()) { | |
explode($locals); | |
ob_start(); | |
include($filename); | |
return ob_get_clean(); | |
} |
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
# Earl: Strings that do web things | |
# | |
# | |
# Examples: | |
# | |
# text = "Blah blah http://tinyurl.com/4bnjzbu blah http://tinyurl.com/4tefu9f" | |
# | |
# text.urls # => ["http://tinyurl.com/4bnjzbu", "http://tinyurl.com/4tefu9f"] | |
# | |
# text.locations # => ["http://nutrun.com/weblog/2010/11/17/supercharged-ruby-console-output.html", "http://nutrun.com"] |
NewerOlder