This file contains hidden or 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
<script type="text/javascript"> | |
$(function() { | |
function cutAndPaste(from, to) { | |
$(to).append(function() { | |
return $(from + " option:selected").each(function() { | |
this.outerHTML; | |
}).remove(); |
This file contains hidden or 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
# -*- encoding : utf-8 -*- | |
class TypesController < ApplicationController | |
# GET /types | |
# GET /types.json | |
def index | |
@types = Type.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @types } |
This file contains hidden or 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
# -*- encoding : utf-8 -*- | |
class PlacesController < ApplicationController | |
# GET /places | |
# GET /places.json | |
def index | |
@places = Place.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @places } |
This file contains hidden or 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
<script type="text/javascript"> | |
$(function() { | |
function cutAndPaste(from, to) { | |
$(to).append(function() { | |
return $(from + " option:selected").each(function() { | |
this.outerHTML; | |
}).remove(); |
This file contains hidden or 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
<div class="page-header"> | |
<%= simple_form_for(@atendimento, :html => {:class => 'form-horizontal' }) do |f| %> | |
</div> |
This file contains hidden or 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
<dirv class="page-header"> | |
<%= simple_form_for(@atendimento, :html => {:class => 'form-horizontal' }) do |f| %> | |
<div class="actions"> | |
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"> |
This file contains hidden or 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 "cancan/matchers" | |
require 'spec_helper' | |
describe "User" do | |
describe "Ability" do | |
subject(:ability){ Ability.new(user) } | |
let(:user){ nil } | |
This file contains hidden or 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
# Read about factories at https://github.com/thoughtbot/factory_girl | |
FactoryGirl.define do | |
factory :user do |f| | |
f.name "Alessandro" | |
f.username "alessandrocb" | |
f.matricula "123456789" | |
f.password "123456789" | |
f.password_confirmation "123456789" | |
f.after(:create) {|user| user.add_role(:student)} |
This file contains hidden or 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
class CreateConvenios < ActiveRecord::Migration | |
def change | |
create_table :convenios do |t| | |
t.string :numeroconvenio | |
t.string :uf | |
t.string :codigosiafi | |
t.string :nomemunicipio | |
t.string :situacaoconvenio | |
t.string :numerooriginal | |
t.string :objetoconvenio |
This file contains hidden or 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
private | |
# Use callbacks to share common setup or constraints between actions. | |
def set_convenio | |
@convenio = Convenio.find(params[:id]) | |
end | |
# Never trust parameters from the scary internet, only allow the white list through. | |
def convenio_params | |
params.require(:convenio).permit(:numeroconvenio, :uf, :codigosiafi, :nomemunicipio, :situacaoconvenio, :numerooriginal, :objetoconvenio, :codigoorgaosuperior, :nomeorgaosuperior, :codigoconcedente, :nomeconcedente, :codigoconvenente, :nomeconvenente, :tipoenteconvenente, :valorconvenio, :valorliberado, :datapublicacao, :datainiciovigencia, :datafimvigencia, :valorcontrapartida, :dataultimaliberacao, :valorultimaliberacao) |
OlderNewer