Skip to content

Instantly share code, notes, and snippets.

View Base Rails Docker Compose File
version: '2'
driver: local
driver: local
kurenn / gist:9205589385479d60d409
Created Apr 8, 2015
A simple client for a simple API
View gist:9205589385479d60d409
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<form action="http://localhost:3000/tasks.json" method="post">
View Gemfile
source ''
# Follows the bundler group pattern described here:
# Gemfile.mine in root dir allows locally custom gems.
# NOTE: Doing this will change the Gemfile.lock - commit with care.
eval, 'Gemfile.mine')) if File.exists? File.join(File.dirname(__FILE__), 'Gemfile.mine')
ruby '1.9.3'
kurenn / gist:4421177
Last active Mar 29, 2017
This gist shows how to make a polymorphic association for users in rails which have an specific role, such as Member, with devise
View gist:4421177
module Userable
def self.included(base)
base.has_one :user, :as => :userable, :dependent => :destroy, :autosave => true
base.validate :user_must_be_valid
base.alias_method_chain :user, :autobuild
base.extend ClassMethods
kurenn / LenguasIndigenas.json
Created Oct 20, 2012
Este es un formato preliminar de como se encuentra actualmente la estrucuta de la API (http://localhost:3000/archives/17.json)
View LenguasIndigenas.json
"Baja California",
kurenn / _form.html.erb
Created Mar 14, 2012
Problema con nested resources y un render parcial
View _form.html.erb
<div class="control-group">
<div class="controls">
<%= link_to_add_fields("Agregar producto", f, :requisitions) %>
<%= f.fields_for :requisitions do |builder| %>
<%= render :partial => 'requisition_fields', :locals => {:f => builder } %>
<% end %>