Skip to content

Instantly share code, notes, and snippets.

admin_store_root /refinery/store(.:format) {:controller=>"admin/store/orders", :action=>"index"}
admin_store_orders GET /refinery/store/orders(.:format) {:action=>"index", :controller=>"admin/store/orders"}
POST /refinery/store/orders(.:format) {:action=>"create", :controller=>"admin/store/orders"}
new_admin_store_order GET /refinery/store/orders/new(.:format) {:action=>"new", :controller=>"admin/store/orders"}
edit_admin_store_order GET /refinery/store/orders/:id/edit(.:format) {:action=>"edit", :controller=>"admin/store/orders"}
admin_store_order GET /refinery/store/orders/:id(.:format) {:action=>"show", :controller=>"admin/store/orders"}
PUT
Alabaster::Application.routes.draw do
scope(:path => 'refinery', :as => 'admin', :module => 'admin') do
scope(:path => 'blog', :as => 'blog', :module => 'blog') do
root :to => 'comments#index'
resources :posts do
get 'uncategorized', :on => :collection
end
end
scope(:path => 'store', :as => 'store', :module => 'store') do
<!DOCTYPE html>
<html>
<head>
<title>Alabaster</title>
<%= stylesheet_link_tag :all %>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<body>
<div id="wrapper" class="1-column-layout">
require "devape_survey/engine"
module DevapeSurvey
config.to_prepare do
ApplicationController.helper(SurveysHelper)
end
end
MAIN FORM
<%= form_for(@project) do |f| %>
<% if @project.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@project.errors.count, "error") %> prohibited this project from being saved:</h2>
<ul>
<% @project.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
#loop through tsv, add to array
f = File.open(input_file, "r")
f.each_with_index { |line, i|
name_index = ""
price_index = ""
if(i==0) then
headers = line.split("\t")
headers[2] = headers.last.strip
name_index = headers.index("Name")
price_index = headers.index("Price")
class Output <
Struct.new(:name, :price)
end
unless ARGV.length == 1
puts "Wrong number of Arguments"
puts "Usage: ruby #{File.basename(__FILE__)} InputFile.tsv > SortedOutputFile.tsv\n"
exit
end
1000.times do |i|
m = Member.create(:email=> i.to_s + "[email protected]", :password=>"foobar", :password_confirmation=>"foobar", :orientation_id=>Orientation.random.first.id, :gender_id=↷
m.isos << Iso.random.first
m.isos << Iso.random.first
end
class Output <
Struct.new(:name, :price)
end
unless ARGV.length == 1
puts "Wrong number of Arguments"
puts "Usage: ruby #{File.basename(__FILE__)} InputFile.tsv"
exit
end
class Output <
Struct.new(:name, :price)
end
unless ARGV.length == 1
puts "Wrong number of Arguments"
puts "Usage: ruby #{File.basename(__FILE__)} InputFile.tsv"
exit
end