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
| <% @listings.each do |listing| %> | |
| <li> | |
| <input type="hidden" name="listing_id" value="<%= listing.id %>" class="listing_id" /> | |
| <% if listing.featured? %> | |
| <%= image_tag("icons/featured_sticker.png", :class => "featuredSticker")%> | |
| <% end %> | |
| <div class="img"> | |
| <% if listing.primary_photo_id.blank? && !listing.vehicle_listing_images.first.nil? %> | |
| <%= link_to(image_tag(listing.vehicle_listing_images.first.vehicle.url(:search), :class => 'primary_image'), listing) %> | |
| <% elsif !listing.primary_photo_id.blank? %> |
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
| bindings[:object].amount.presence.to_f.try(:number_to_currency) | |
| returns >>> | |
| undefined method `number_to_currency' for 139.0:Float | |
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
| <ul id="listings"> | |
| <% @listings.each do |listing| %> | |
| <li <%= "class=stickered" if listing.investor_car? || listing.sticker? %>> | |
| <input type="hidden" name="listing_id" value="<%= listing.id %>" class="listing_id" /> | |
| <% if listing.featured? %> | |
| <%= image_tag("icons/featured_sticker.png", :class => "featuredSticker")%> | |
| <% end %> | |
| <div class="img"> | |
| <% if listing.primary_photo_id.blank? && !listing.vehicle_listing_images.first.nil? %> | |
| <%= link_to(image_tag(listing.vehicle_listing_images.first.vehicle.url(:search), :class => 'primary_image'), listing) %> |
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
| ENV["WATCHR"] = "1" | |
| system 'clear' | |
| def growl(message) | |
| growlnotify = `which growlnotify`.chomp | |
| title = "Watchr Test Results" | |
| puts message | |
| image = message.match(/\s0\s(errors|failures)/) ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png" | |
| options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'" | |
| system %(#{growlnotify} #{options} &) |
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
| #!/usr/bin/env watchr | |
| #RUN_ALL_TESTS||=true | |
| #watchr runs through this file a few times | |
| #ensure it only gets set once | |
| unless defined?(GROWL) | |
| $stderr.sync=true | |
| $stdout.sync=true | |
| ENV["WATCHR"] = "1" | |
| GROWL=`which growlnotify`.chomp |
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 to_param | |
| "#{title.downcase.gsub(/[^a-zA-Z0-9]+/, '-').gsub(/-{2,}/, '-').gsub(/^-|-$/, '')}" | |
| 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
| def self.supernav | |
| new_array = ['Home', 'Referring Physicians', 'Patient Pre-Registration', 'Locations', 'About Us', 'Contact Us'] | |
| Page.where(:title => new_array) | |
| 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
| def show | |
| @page = Page.find(params[:id]) | |
| @supernav = Page.supnav | |
| @mainnav = Page.mainnav | |
| respond_to do |format| | |
| format.html { if @page.title == 'Home' | |
| render :template => "pages/home" | |
| else | |
| render :html => @page |
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 UserMailer < ActionMailer::Base | |
| default :from => "contact@investyourcar.com" | |
| def reset_password_email(user) | |
| @user = user | |
| @reset_password_link = edit_password_reset_url(user.perishable_token) | |
| mail( | |
| :to => user.email, | |
| :from => "contact@investyourcar.com", | |
| :subject => 'Reset password instructions' |
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 dealerimport_notification(contact, user) | |
| @contact = contact | |
| @user = user | |
| if @contact.(params[:provider]) == 'CarForSale.com' | |
| mail( | |
| :to => 'jonpaul@glideint.com', | |
| :from => @user.email, | |
| :subject => 'A New Listings Import Request has been made for CarForSale.' | |
| ) |