I hereby claim:
- I am lucasprag on github.
- I am lucasprag (https://keybase.io/lucasprag) on keybase.
- I have a public key ASChddlvcPbpDGTvh-JTu2EEaUhLuudGcR5bsz2-yExnfQo
To claim this, I am signing this object:
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem 'liquid' | |
gem 'ruby-handlebars' |
I hereby claim:
To claim this, I am signing this object:
User.create(first_name: '', last_name: '', email: 'yourname@attendease.com', password: 'test42') |
Rails.application.routes.draw do | |
scope :admin do | |
resources :pages do | |
resources :sections | |
end | |
resources :posts | |
resources :categories | |
resource :settings |
module MeuSite | |
class Application < Rails::Application | |
# ... | |
config.middleware.use = HelloHeader | |
# insere o NovoMiddleware DEPOIS do MiddlewareExistente | |
config.middleware.insert_after(MiddlewareExistente, NovoMiddleware) |
module MeuSite | |
class Application < Rails::Application | |
# ... | |
config.middleware.use = HelloHeader | |
end | |
end |
class HelloHeader | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
status, headers, body = @app.call(env) | |
headers['Hello'] = 'World' | |
[status, headers, body] |
module ActiveRecord | |
class Migration | |
class CheckPending | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
ActiveRecord::Base.logger.silence do | |
ActiveRecord:: Migration.check_pending! |
<% @posts.each do |post| %> | |
<h3><%= post.title %></h3> | |
<p><%= post.content %></p> | |
<% end %> |
class BlogController < ApplicationController | |
def index | |
@posts = Post.all | |
end | |
end |