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
| def new_list_item_link | |
| content_for :action_links do | |
| link_to "New #{controller.controller_name.humanize.titleize.singularize}", eval("new_managed_lists_#{controller.controller_name.singularize}_path") | |
| end | |
| end | |
| describe "#new_list_item_link" do | |
| before do | |
| helper.should_receive(:new_managed_lists_test_path).and_return 'test_path_url' | |
| helper.new_list_item_link |
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
| <?xml ...?> | |
| <% @posts.each do |post| -%> | |
| <post> | |
| <title><%= post.title %></title> | |
| <content> | |
| <%= render :partial => '...' %> | |
| </content> | |
| </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
| def client_threshold_reached? | |
| self.plan.num_of_clients == self.clients.count | |
| 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
| @available_fetchers = Fetcherr.all | |
| if @available_fetchers.empty? | |
| puts "No fetchers found" | |
| else | |
| @available_fetchers.each do |fetcher| | |
| puts "Loading the #{fetcher.name} fetcher" | |
| klass = Class.new do | |
| include HTTParty |
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 Link | |
| attr_reader :url | |
| def initialize(url) | |
| @url = url | |
| end | |
| def bad? | |
| return false if link.blank? | |
| (GlobalPreference.get('suspicious_words') + GlobalPreference.get('bad_words')).any? { |word| url =~ eval("/#{word.strip}/") } |
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
| module Invite | |
| module Inviter | |
| def self.included(base) | |
| base.extend(ClassMethods) | |
| end | |
| module ClassMethods | |
| attr_reader :invite_block |
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_for ([@ticket.ticketable, @ticket]) do |f| | |
| = debug @ticket | |
| = debug ticket.ticketable | |
| = f.error_messages | |
| %p | |
| = f.label :title, "Brief Title for Issue" | |
| = f.text_field :title | |
| %p | |
| = f.label :call_type | |
| %br/ |
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
| => Booting WEBrick | |
| => Rails 3.0.3 application starting in development on http://0.0.0.0:3000 | |
| => Call with -d to detach | |
| => Ctrl-C to shutdown server | |
| [2011-01-18 20:53:12] INFO WEBrick 1.3.1 | |
| [2011-01-18 20:53:12] INFO ruby 1.9.2 (2010-12-25) [x86_64-darwin10.5.0] | |
| [2011-01-18 20:53:12] INFO WEBrick::HTTPServer#start: pid=3154 port=3000 | |
| Started POST "/tickets" for 127.0.0.1 at 2011-01-18 20:53:44 -0500 |
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
| Started GET "/companies/3/tickets/new" for 127.0.0.1 at 2011-01-18 20:34:21 -0500 | |
| Processing by TicketsController#new as HTML | |
| Parameters: {"company_id"=>"3"} | |
| SQL (0.4ms) SHOW TABLES | |
| User Load (0.3ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
| CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 | |
| Completed in 98ms | |
| ActiveRecord::RecordNotFound (Couldn't find Company without an ID): | |
| app/controllers/tickets_controller.rb:54:in `find_company' |
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 CompaniesController < ApplicationController | |
| # GET /companies | |
| # GET /companies.xml | |
| def index | |
| @companies = Company.all | |
| respond_to do |format| | |
| format.html # index.html.erb | |
| format.xml { render :xml => @companies } | |
| end |
NewerOlder