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
ko.nativeTemplateEngine = function () { | |
// monkey patch to convert possible NodeList into Array before iterating | |
ko.utils._setDomNodeChildren = ko.utils.setDomNodeChildren; | |
ko.utils.setDomNodeChildren = function (domNode, childNodes) { | |
var childNodesArray = Array.prototype.slice.call(childNodes); | |
ko.utils._setDomNodeChildren(domNode, childNodesArray); | |
}; | |
// adapted from MooTools.Element | |
// |
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
/* | |
Handlebars Template Engine for Knockout JavaScript library | |
*//*! | |
Copyright (c) 2011 Mark J. Titorenko | |
License: MIT (http://www.opensource.org/licenses/mit-license.php) | |
*/ | |
ko.handlebarsTemplateEngine = function () { | |
// adapted from MooTools.Element | |
// | |
// This is necessary to allow us to easily deal with table |
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 ActionDispatch | |
class ShowExceptions | |
private | |
# override public_path, because keeping static error pages in | |
# <Rails.root>/public is, well, ridiculous, as they can be | |
# statically accessed. It's. Just. Wrong. | |
def public_path | |
"#{Rails.root}/config/errors" | |
end | |
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
# app/models/kebab.rb | |
module Kebab | |
class << self | |
def table_name_prefix | |
'kebab_' | |
end | |
end | |
end | |
# app/models/kebab/user.rb -- should work now |
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 Mail | |
class Message | |
include ActionView::Helpers::TextHelper | |
def deliver_with_word_wrap | |
self.body = word_wrap(self.body, :line_width => 70) | |
deliver_without_word_wrap | |
end | |
alias_method_chain :deliver, :word_wrap |
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
<%= simple_form_for([@pacient, @retetum]) do |f| %> | |
<%= f.error_notification %> | |
<div class="inputs"> | |
<%= f.input :data %> | |
<%= f.input :cantitate %> | |
<%= f.input :serie %> | |
<%= f.input :medicamente_id do %> | |
<%# select(:retetum, :medicamente_id, Medicamente.pastile) %> | |
<%= select(:retetum, :medicamente_id, Medicamente.clase, |
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 LinkedSecrets | |
class << self | |
def token | |
"XXXX" | |
end | |
def secret | |
"YYYY" | |
end | |
end | |
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
require File.expand_path('../boot', __FILE__) | |
# Frameworks | |
# I don't use activerecord, but if you did, you'd want the following line too: | |
# require "active_record/railtie" | |
require "action_controller/railtie" | |
require "action_mailer/railtie" | |
require "active_resource/railtie" | |
require "rails/test_unit/railtie" | |
#require "sprockets/railtie" |
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 :wtp do | |
namespace :jsroutes do | |
desc "Regenerate routes for users" | |
task :users do | |
puts "Recreating routes for users..." | |
JsRoutes.generate!({}) | |
end | |
end | |
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
locales.en.yml | |
for_further_info_html: 'For further information, please view the %{link}.' | |
for_further_info: 'For further information, please view the %{link}.' | |
info_link: 'the info link' | |
view: | |
# works with 'magic suffix' | |
t '.for_further_info_html', :link => link_to(t('.info_link'), '/info', target: '_blank') | |
# doesn't work, wtf? |
OlderNewer