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
resource :contacts, :only => [], :path => 'rsvp' do | |
get :new | |
post :create | |
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
#this is sort of ridiculous, is there a better way? | |
resource :contacts, :only => [], :path => 'rsvp' do | |
get :new | |
get :thank | |
post :create | |
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
<div id="edit_user_form" class="blue_fields"> | |
<%= form_for [:admin, @user] do |f| %> | |
<%= qm_error_messages("account information", @user) %> | |
<div> | |
<%= f.check_box :admin %> | |
<%= f.label :admin, "Is an admin?" %> | |
</div> | |
<br /> |
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
test "paypal validation helper" do | |
address = "1 Main St" | |
zipcode = 95131 | |
emails = %w{ | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] | |
[email protected] |
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
def check_username_is_allowed | |
RESTRICTED_NAMES.each do |restricted| | |
- errors.add(:username, "is not available") if | |
- username =~ /#{restricted}/i unless errors.on(:username) | |
+ errors[:username] << "is not available" if | |
+ username =~ /#{restricted}/i unless errors[:username] and errors[:username].size != 0 | |
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
<%= form_for(@opportunity) do |f| %> | |
#... | |
<% f.fields_for :opportunity_filters do |filter_form| %> | |
<%= render 'opportunity_filters/edit_form', | |
:collection => @opportunity.opportunity_filters, | |
:as => :opportunity_filter, :locals => {:f => filter_form} %> | |
<% 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
#in the form | |
<% if @opportunity.opportunity_filters.size > 0 %> | |
<% f.fields_for :opportunity_filters do |filter_form| %> | |
<%= render 'opportunity_filters/edit_form', | |
:locals => {:foo => @opportunity.opportunity_filters[0], :f => filter_form} %> | |
<% end %> | |
<% end %> | |
#the partial [just for testing, filter_type is an attribute of opportunity_filter] |
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
opportunities GET /questionnaires(.:format) {:action=>"index", :controller=>"opportunities"} | |
opportunities POST /questionnaires(.:format) {:action=>"create", :controller=>"opportunities"} | |
new_opportunity GET /questionnaires/new(.:format) {:action=>"new", :controller=>"opportunities"} | |
edit_opportunity GET /questionnaires/:id/edit(.:format) {:action=>"edit", :controller=>"opportunities"} | |
opportunity GET /questionnaires/:id(.:format) {:action=>"show", :controller=>"opportunities"} | |
opportunity PUT /questionnaires/:id(.:format) {:action=>"update", :controller=>"opportunities"} | |
opportunity DELETE /questionnaires/:id(.:format) {:action=>"destroy", :controller=>"opportunities"} |
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
<%= form_for(@new_product_template, | |
:url => opportunity_new_product_template_path(@opportunity), | |
:html => {:method => :put, :multipart => true}) do |f| %> |
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 Foo < ActiveRecord::Base | |
has_many :bars | |
end | |
class Bar < ActiveRecord::Base | |
belongs_to :foo, :polymorphic => true #is polymorphic even needed? | |
end | |
class Baz < Bar | |
end |
OlderNewer