Skip to content

Instantly share code, notes, and snippets.

@Ziaw
Ziaw / custom_slim_scaffold.rb
Created May 13, 2016 10:00
custom scaffold slim views rails initializer file
if Rails.env.development?
# copy templates from slim-rails to lib/generators/slim/scaffold/templates and customize
module App
class Application < ::Rails::Application
generators do
require 'generators/slim/scaffold/scaffold_generator'
Slim::Generators::ScaffoldGenerator.class_eval do
source_root File.expand_path('../../../lib/generators/slim/scaffold/templates', __FILE__)
end
using Nemerle;
using Nemerle.Collections;
using Nemerle.Compiler;
using Nemerle.Compiler.Parsetree;
using Nemerle.Text;
using Nemerle.Utility;
using System;
using System.Collections.Generic;
using System.Linq;
function DataGate() {
var loadOne = function (url, ctor, callback) {
$.getJSON(url, function (model) {
var result = new ctor(model);
callback(result);
});
};
var loadMany = function (url, ctor, callback) {
$.getJSON(url, function (model) {