Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

0ptimus's Profile

GitHub User: 0ptimus

Comments by


Hi guys, I have an app listing a bunch of inventory items and on my views I am showing columns with item.created_at and item.updated_at. After following this tutorial I have all of my columns sorting fine with the "arrows", except that I can't get the item.created_at and item.updated_at columns to sort. Any tips?

Thanks for any help!!!


Troy, yeah, it's just an updatable list of printers. Not doing it in Active Directory. Hopefully someone can help with my issues :)!


Thanks for all of the awesome tutorials Ryan!!! I'm a total Rails/coding newbie and I managed to build a directory of printers for my IT dept with your help :). Now I followed this tutorial to try and get emails sent via a Gmail account to a list address ( whenever a new printer is added to the directory. However, I'm stumped as to how to get this working with my rails app and I hope you or someone else can help. Please be gentle with me :). My app is a little different from your example code as I don't require a user registration, it's just a simple directory listing printers (make, model, IP address, IP address, etc.), and people can add/edit/delete printers from the "directory". I am including code from my app which I think is relevant below, although I could be wrong :). There's probably something horribly obvious to you or others which I am not seeing or able to figure out. I'd appreciate any help in advice on getting this working. Or if I should be going a different route to send the emails, please let me know.


Sample from my setup_mail.rb

ActionMailer::Base.smtp_settings = {
:address => "",
:port => "587",
:domain => "",
:user_name => "",
:password => "secret",
:authentication => "plain",
:enable_starttls_auto => true

ActionMailer::Base.default_url_options[:host] = "localhost:80"
Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?

Sample from my notifier.rb

class Notifier < ActionMailer::Base
default :from => ""

def newprinter_notification(list)
@list = ""
mail(:to => @list, :subject => "New Printer Added to Directory")


Sample from my printers_controller.rb

def create
@printer =[:printer])

respond_to do |format|
    format.html { redirect_to @printer, notice: 'Printer was successfully created.' }
    format.json { render json: @printer, status: :created, location: @printer }
    format.html { render action: "new" }
    format.json { render json: @printer.errors, status: :unprocessable_entity }