Skip to content

Instantly share code, notes, and snippets.

View adagio's full-sized avatar
👨‍💻
practicing NestJS / learning about AI

Edu F adagio

👨‍💻
practicing NestJS / learning about AI
View GitHub Profile
@adagio
adagio / myentity_controller.rb
Last active August 29, 2015 14:05
Filtering in Controller. Within a month, one date given
#
@things = Thing.where(date: (@[email protected]_of_month)).all.sort_by &:date
#
@adagio
adagio / myaction.html.erb
Created August 20, 2014 23:59
Sending Parameters from View to Controller
#
<%= link_to "link text", things_path(:myparam => @myParamValue) %>
#
@adagio
adagio / myaction.html.erb
Created August 21, 2014 00:15
Sending parameter from a link_to tag
#
<%= link_to 'Link text', things_path(:dateparam => @thing.date) %>
#
@adagio
adagio / Gemfile
Created August 27, 2014 16:48
Includes turbolinks in Gemfile
...
gem 'jquery-turbolinks'
...
@adagio
adagio / application.js
Created August 27, 2014 16:49
Requires jquery.turbolinks in JS app
...
//= require jquery.turbolinks
...
@adagio
adagio / myentity.js.coffee.erb
Last active August 29, 2015 14:05
Assigns value of CONSTANT to JS variable
$ ->
...
special_value = '<%= MyEntity::NAME_OF_CONSTANT %>'
...
@adagio
adagio / myentity.rb
Created August 27, 2014 21:19
Set a value to the CONSTANT
class MyEntity < ActiveRecord::Base
...
NAME_OF_CONSTANT = 'Value of constant'
...
end
@adagio
adagio / app.js
Created August 28, 2014 03:38
declare the app name, as a module
var app = angular.module('myApp', []);
@adagio
adagio / app.js
Last active August 29, 2015 14:05
Basic minimun Angular implementation
var app = angular.module('store', []);
@adagio
adagio / application_helper.rb
Last active August 29, 2015 14:05
Method that generates title markup for the layout
module ApplicationHelper
def title(page_title)
content_for(:title) { page_title }
end
end