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 Article < ActiveRecord::Base | |
after_create :submit_to_crossref | |
include Crossref | |
end | |
module Crossref | |
private | |
def submit_to_crossref | |
# call helpers to format and submit the request |
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 Article < ActiveRecord::Base | |
after_create :submit_to_crossref | |
private | |
def submit_to_crossref | |
# convert article to xml | |
# format a crossref request | |
# connect to crossref using net/http | |
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
class ArticleTest < ActiveSupport::TestCase | |
should_validate_presence_of :title, :abstract, :body, :author | |
should "submit to crossref after being saved" do | |
title = 'a title' | |
# other constants | |
# expectations for net/http | |
Factory(:article, :title => title, ...) | |
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
class Article < ActiveRecord::Base | |
validates_presence_of :title, :abstract, :body, :author | |
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
class ArticleTest < ActiveSupport::TestCase | |
should_validate_presence_of :title, :abstract, :body, :author | |
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
form#new_user #first_name.text_field input { | |
float: left; | |
clear: both; | |
} |
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
input { | |
float: left; | |
clear: both; | |
} |
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
<div> | |
<%= form.label :location %> | |
<%= form.select :location, Location::ALL, :include_blank => true %> | |
</div> |
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
<div> | |
<%= form.label :location %> | |
<%= form.select :location, Location::ALL %> | |
</div> |
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
<div> | |
<%= form.label :title %> | |
<%= form.text_field :title %> | |
</div> |