Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
78 additions
and
30 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
class ParticipationsController < ApplicationController | ||
def index | ||
Participation.new.deployed!(user_id, ENV) | ||
end | ||
|
||
def update | ||
Participation.new(params[:participation]).announce!(user_id, ENV) | ||
redirect_to :action => "done" | ||
end | ||
|
||
def done | ||
end | ||
|
||
protected | ||
def user_id | ||
session[:user_id] ||= Time.now.to_s | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ParticipationsHelper | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
class Participation | ||
def self.deployed!(user_id, env) | ||
include ActiveModel::Validations | ||
include ActiveModel::Conversion | ||
extend ActiveModel::Naming | ||
|
||
attr_accessor :name | ||
def initialize(attributes = {}) | ||
attributes.each do |name, value| | ||
send("#{name}=", value) | ||
end | ||
end | ||
|
||
def persisted? | ||
false | ||
end | ||
|
||
def deployed!(user_id, env) | ||
# TODO - announce "deployed" to central server | ||
end | ||
|
||
def self.announce!(user_id, env, participation) | ||
def announce!(user_id, env) | ||
# TODO - announce "submitted" to central server | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
- content_for :section_title do | ||
Deployed! | ||
|
||
- semantic_form_for(Participation.new) do |f| | ||
- f.inputs :name => 'Information' do | ||
= f.input :name, :label => 'Your names' | ||
|
||
- f.buttons do | ||
= f.commit_button 'Submit' | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'spec_helper' | ||
|
||
describe ParticipationsController do | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'spec_helper' | ||
|
||
# Specs in this file have access to a helper object that includes | ||
# the ParticipationsHelper. For example: | ||
# | ||
# describe ParticipationsHelper do | ||
# describe "string concat" do | ||
# it "concats two strings with spaces" do | ||
# helper.concat_strings("this","that").should == "this that" | ||
# end | ||
# end | ||
# end | ||
describe ParticipationsHelper do | ||
pending "add some examples to (or delete) #{__FILE__}" | ||
end |