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
class MeasurementsController < ApplicationController | |
before_filter :authenticate_user! | |
# GET /measurements | |
# GET /measurements.json | |
def index | |
@measurements = Measurement.all | |
respond_to do |format| |
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
class Measurement < ActiveRecord::Base | |
attr_accessible :bf, :created_on, :geo, :mass, :note, :user_id, :updated_on | |
belongs_to :user | |
validates :bf, :numericality => true | |
validates :mass, :numericality => true | |
end |
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
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :token_authenticatable, :confirmable, | |
# :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable | |
# Setup accessible (or protected) attributes for your model | |
attr_accessible :email, :password, :password_confirmation, :remember_me | |
# attr_accessible :title, :body |
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
class Ability | |
include CanCan::Ability | |
def initialize user, options = {} | |
if !user | |
can :read, :all | |
end | |
if user.has_role? :admin | |
can :manage, :all |
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
class MeasurementsController < ApplicationController | |
before_filter :authenticate_user! | |
load_and_authorize_resource | |
# GET /measurements | |
# GET /measurements.json | |
def index | |
@measurements = Measurement.all |
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
%YAML 1.1 | |
--- | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<link rel="icon" href="./favicon.ico" type="image/x-icon" /> | |
<link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> | |
<title>phpMyAdmin</title> |
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
card kingdom builds their buy list using one big POST form. the fields are product_id, style and qty. each are an array starting at key 0. | |
http://www.cardkingdom.com/sellcart/add?product_id[0]=26268&style[0]=NM&qty[0]=22 will add 22 Near-Mint Imperial Recruiter to the buy list, EG. | |
Troll And Toad has an annoying AJAX thing going on which seems to be a bitch to work with. they also let the user download a csv | |
https://www.trollandtoad.com/secure/selling.php?Department=M&Format=CSV |