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 / index.html.erb
Created August 30, 2014 23:48
Render @Weeks on index View
...
<%= render @weeks %>
...
@adagio
adagio / weeks_controller.rb
Created August 30, 2014 23:41
Create a Controller to simply retrieve all records for the entity
class WeeksController < ApplicationController
# GET /weeks
def index
@weeks = Week.all
end
end
@adagio
adagio / week.rb
Last active August 29, 2015 14:05
Declare the model that inherits from ActiveResource::Base
class Week < ActiveResource::Base
self.site = "http://api.service.com/v1:3000"
end
@adagio
adagio / Gemfile
Created August 30, 2014 23:27
Include ActiveResource in Gemfile
gem 'activeresource', require: 'active_resource'
@adagio
adagio / application.html.erb
Created August 30, 2014 22:50
Use title defined in the View
<title><%= content_for?(:title) ? yield(:title) + " | My Website" : "My Website" %></title>
@adagio
adagio / myaction.html.erb
Created August 30, 2014 22:47
Set a meaningful title using the defined method
<% title "Meaningful title #{@meaningful_text}" %>
@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
@adagio
adagio / app.js
Last active August 29, 2015 14:05
Basic minimun Angular implementation
var app = angular.module('store', []);
@adagio
adagio / app.js
Created August 28, 2014 03:38
declare the app name, as a module
var app = angular.module('myApp', []);
@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