Skip to content

Instantly share code, notes, and snippets.

Emanoel Lopes emanoelopes

Block or report user

Report or block emanoelopes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
emanoelopes / messages.rb
Last active Sep 25, 2017
CRUD de messagens para a API do SOLAR
View messages.rb
module V1
class Messages < Base
namespace :message do
helpers do
# return a @message object
def verify_user_permission_and_set_obj(permission) # permission = [:index, :create, ...]
emanoelopes / cliente.rb
Created Oct 25, 2016
Fancybox template missing
View cliente.rb
def new
@cliente =
render layout: 'fancybox'
emanoelopes / unicorn_votaprato
Created Oct 18, 2016
unicorn initialization script
View unicorn_votaprato
# Provides: unicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn app server
# Description: starts unicorn using start-stop-daemon
View qualificacao.rb
class Qualificacao < ActiveRecord::Base
include Wisper::Publisher
after_create :publish_creation_successful
def publish_creation_successful
broadcast(:qualificacao_creation_successful, self)
View _form.html.erb
<% if @restaurante.errors.any? %>
<% @restaurante.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
<% end %>
<%= form_for @restaurantes, html: {multipart: true} do |f| %>
Nome: <%= f.text_field :nome %> <br>
Endereço: <%= f.text_field :endereco %><br>
You can’t perform that action at this time.