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
| # create a link to an action. A confirm box will pop up before | |
| # you can process to action specified here. | |
| # link_to_action "Delete", "Are you sure?", :method => 'delete', | |
| # :class => "negative", :controller => 'price_letters', | |
| # :action => 'destroy', :id => letter.id | |
| # link_to_action "Effect Now", "Take effect now, and can not be reversed?", | |
| # :controller => "price_letters", :action => 'effect_now', :id => letter.id | |
| def link_to_action(link_text, msg = "Are you sure", attributes = {}) | |
| content = (msg || "Are you sure?") | |
| attrs = { :method => 'post' } |
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
| # Helper method to adding the fixtures into the tests | |
| def fixtures(*files) | |
| files.each do |file| | |
| klass = begin | |
| Kernel::const_get(Extlib::Inflection.classify(Extlib::Inflection.singularize(file.to_s))) | |
| rescue | |
| nil | |
| end | |
| entries = YAML::load_file(File.dirname(__FILE__) + "/fixtures/#{file}.yml") | |
| # do a migrate to create the table to clear the records |
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
| # spec_helper.rb | |
| # Helper method to adding the fixtures into the tests | |
| def fixtures(*files) | |
| files.each do |file| | |
| klass = begin | |
| Kernel::const_get( | |
| Extlib::Inflection.classify( | |
| Extlib::Inflection.singularize(file.to_s))) | |
| rescue | |
| nil |
NewerOlder