This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
en: | |
routes: | |
pt-BR: | |
routes: | |
home: inicio | |
new: novo | |
edit: editar | |
destroy: destruir | |
password: senha | |
sign_in: entrar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#show.html.erb | |
<%= link_to show_image(r.imagem_url(:thumb)), reclamacao_path(r) %> | |
<%= link_to reclamacao_path(r) do %> | |
<%= image_tag(r.imagem_url(:thumb)) if r.imagem.present? %> | |
<% end %> | |
#application_helper.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'faker' | |
puts '---Cleaning DataBase --' | |
[User].map(&:delete_all) | |
#admin | |
puts '---Creating Admin user ---' | |
User.create!(email: '[email protected]', password: 'taskpass', name: 'Admin Tasks') | |
#normal users |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# your controller | |
def export_pdf | |
html = render :layout => 'print' #or false | |
kit = PDFKit.new(html) | |
kit.stylesheets << "#{Rails.root/app/assets/stylesheets/print.css" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Application Generator Template | |
# Modifies a Rails app to use Devise with RSpec and Cucumber | |
# Usage: rails new APP_NAME -m rails_template.rb -T | |
# Information and a tutorial: | |
# https://github.com/RailsApps/rails3-devise-rspec-cucumber | |
# Generated using the rails_apps_composer gem: | |
# https://github.com/RailsApps/rails_apps_composer/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Artist Model | |
class Artist < ActiveRecord::Base | |
has_many :performers, :dependent => :destroy | |
has_many :musics, :through => :performers | |
#default_scope order(:name) | |
def self.find_ordened_artists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: nginx init.d script for Ubuntu 8.10 and lesser versions. | |
# Description: nginx init.d script for Ubuntu 8.10 and lesser versions. | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# General | |
ssh_options[:keys] = ["#{ENV['HOME']}/.ssh/amazon.pem"] | |
set :application, "test_app" | |
set :user, "ubuntu" | |
set :domain, "your_domain.com" | |
set :deploy_to, "/home/#{user}/#{application}" | |
set :deploy_via, :copy | |
set :use_sudo, false |