This Presentation was built to be viewed with GistDeck
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 "savon" | |
# client = Savon::Client.new("http://api.savvistaging.com/account.svc?wsdl") | |
client = Savon::Client.new do | |
wsdl.namespace = "http://api.savvistaging.com/account.svc?wsdl" | |
wsdl.endpoint = "http://api.savvistaging.com/Account.svc/www/account" | |
end | |
response = client.request "CreateAccount" do | |
namespaces = { | |
"xmlns:soapenv" => "http://schemas.xmlsoap.org/soap/envelope/", |
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 ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :check_host | |
def check_host | |
if request.host.split('.')[0] == 'www' | |
redirect_to "http://" + request.host.gsub('www.','') | |
end | |
end | |
end |
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
def aviarycreate | |
@photo = Photo.new | |
@photo.user_id = current_user.id | |
@photo.remote_image_url = params[:url] | |
@photo.save | |
respond_to do |format| | |
format.json { render json: @photo } | |
end | |
end |
This Presentation was built to be viewed with GistDeck
DRUG September 5, 2012
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
## Create User | |
User.create! :first_name => "Test", :last_name => "User", :email => "[email protected]", :password => "password123"# add whatever other parameters you have here | |
# if you wanted to make user an admin (which I'm assuming you do if it's in a seed file) do: | |
u = User.create! :first_name => "Test", :last_name => "User", :email => "[email protected]", :password => "password123" | |
u.spree_roles << Spree::Role.find_or_create_by_name("admin") |
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
#... | |
namespace :deploy do | |
desc "reload the database with seed data" | |
task :seed do | |
run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}" | |
end | |
end | |
#... |
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
def create_url | |
country = Country.where(:name => params[:country]).first | |
@wine = Wine.create( | |
:name => params[:name], | |
:country => BSON::ObjectId.from_string(country.id.to_s), | |
:region => params[:region], | |
:varietal => params[:varietal], | |
:producer => params[:producer], | |
:wine_type => params[:wine_type], | |
:year => params[:year], |
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
# Letter opener config: | |
# https://github.com/ryanb/letter_opener | |
... | |
# Change mail delvery to either :smtp, :sendmail, :file, :test | |
config.action_mailer.delivery_method = :letter_opener | |
.... |
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
group :development do | |
gem "pry" | |
gem "powder" | |
gem "letter_opener" | |
gem "better_errors", ">= 0.7.2" | |
gem "binding_of_caller", ">= 0.7.1" | |
gem 'meta_request' | |
gem "html2haml", ">= 1.0.1" | |
gem 'guard' | |
gem 'rb-fsevent', require: false |
OlderNewer