Skip to content

Instantly share code, notes, and snippets.

View fellix's full-sized avatar

Rafael Felix fellix

View GitHub Profile
class SomethingController < ApplicationController
respond_to :html, :json
def show
@something = Something.find(params[:id])
respond_with(@something) do |format|
format.html { render :layout => 'report' }
end
end
end
@fellix
fellix / script.rb
Created October 23, 2012 16:51 — forked from manfe/script.rb
Recuperando Cidades de Estados Brasileiros
require 'nokogiri'
require 'htmlentities'
require 'open-uri'
doc = Nokogiri::HTML(open('http://www.ibge.gov.br/cidadesat/includes/ac.inc'))
doc = doc.xpath('//p')
doc.each do |c|
@variables = c.text