The Stout Design Blog

Dates in Rails

Just another reminder for me: %a – The abbreviated weekday name (“Sun”) %A – The full weekday name (“Sunday”) %b – The abbreviated month name (“Jan”) %B – The full month name (“January”) %c – The preferred local date and time representation %d – Day of the month (01..31) %e – Day of the month
[Read More...]

Posted in Rails | Leave a comment

Rails 3, respond_with, RESTful resources and namespaces

I struggled with the exact syntax on using respond_with within my `:admin` namespace. Failed, validations weren’t redirecting to the proper location and other strange routing issues were occuring. As usual, I was over-complicating things and I simply needed to supply the array without the square brackets. So here’s a basic example # excerpt from routes.rb
[Read More...]

Posted in Rails | Tagged | 1 Comment

Stout Google Calendar Released!

The Stout Google Calendar plugin for WordPress has been released! You can read more about it on the Stout Google Calendar page on this site or download it from the WordPress Plugin directory. If you have any questions or suggestions, please let us know in the forum.

Posted in WordPress Plugins | Tagged , | Leave a comment

Rails CSV file modes

r – Open a file for reading. The file must exist. w – Create an empty file for writing. If a file with the same name already exists its content is erased and the file is treated as a new empty file. a – Append to a file. Writing operations append data at the end
[Read More...]

Posted in Rails | Tagged | Comments closed

Apache won’t restart

I was getting this error on my server: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down So I did this: sudo netstat -lnp | grep ’80′#output tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1579/apache2 And then this: ps 1579 #output PID TTY      STAT   TIME COMMAND 1579 ?       
[Read More...]

Posted in Rails | Tagged | Comments closed

ActiveMerchant tweaks for Authorize.net test transactions

Here’s a link to an explanation and code for modifying the authorize_net.rb gateway file in ActiveMerchant. ActiveMerchant, by default, routes requests to the test server if ActiveMerchant::Billing::Base.mode = :test is set. However, you should be able to authenticate to their production server(s) and send a test transaction. The only drawback to this is that no
[Read More...]

Posted in Rails | Tagged , , | Comments closed

Authorize.net test and live modes

Here’s a good article to help understand what the Authorize.net’s terminology. http://drp.itdevworks.com/index.php/2009/10/authorize-net-terminology-overload-test-vs-live/

Posted in Rails | Tagged , | Comments closed

[ActionMailer] Multipart emails with attachments

Need to send a multi-part email with an attachment? Here’s a post from Daniel LeBare at ELC on the correct way to do it. http://www.elctech.com/articles/-actionmailer-multipart-emails-with-attachments Here’s the idea (excerpted from the site above) def order_placed(purchase) setup_email recipients "email@example.com" subject "Your #{APP_NAME} receipt" content_type "multipart/mixed" part :content_type => "multipart/alternative" do |a| a.part "text/plain" do |p| p.body
[Read More...]

Posted in Rails | Tagged , | Comments closed