Search Results

Search found 111 results on 5 pages for 'actionmailer'.

Page 2/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Setting up sendgrid for rails..returning Authorization error

    - by Trip
    The emails now send from my local, but do not send from my box. I am returned this error. Anyone know what this might be? Net::SMTPAuthenticationError (535 5.7.8 Error: authentication failed: authentication failure ): My environments/production.rb ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.sendgrid.net", :port => '25', :domain => "mydomain.com", :authentication => :plain, :user_name => "[email protected]", :password => "password1234" } /etc/ssmtp/ssmtp.conf : root=postmaster mailhub=smtp.sendgrid.net [email protected] AuthPass=password1234 AuthMethod=LOGIN rewriteDomain=mydomain.com FromLineOverride=YES UseSTARTTLS=NO

    Read the article

  • Best practice on structuring asynchronous mailers (using Sidekiq)

    - by gbdev
    Just wondering what's the best way to go about structuring asynchronous mailers in my Rails app (using Sidekiq)? I have one ActionMailer class with multiple methods/emails... notifier.rb: class Notifier < ActionMailer::Base default from: "\"Company Name\" <[email protected]>" default_url_options[:host] = Rails.env.production? ? 'domain.com' : 'localhost:5000' def welcome_email(user) @user = user mail to: @user.email, subject: "Thanks for signing up!" end ... def password_reset(user) @user = user @edit_password_reset_url = edit_password_reset_url(user.perishable_token) mail to: @user.email, subject: "Password Reset" end end Then for example, the password_reset mail is sent in my User model by doing... user.rb: def deliver_password_reset_instructions! reset_perishable_token! NotifierWorker.perform_async(self) end notifier_worker.rb: class NotifierWorker include Sidekiq::Worker sidekiq_options queue: "mail" def perform(user) Notifier.password_reset(user).deliver end end So I guess I'm wondering a couple things here... Is it possible to define many "perform" actions in one single worker? By doing so I could keep things simple (one notifier/mail worker) as I have it and send many different emails through it. Or should I create many workers? One for each mailer (e.g. WelcomeEmailWorker, PasswordResetWorker, etc) and just assign them all to use the same "mail" queue with Sidekiq. I know it works as it is, but should I break out each of those mail methods (welcome_email, password_reset, etc) into individually mailer classes or is it ok to have them all under one class like Notifier? Really appreciate any advice here. Thanks!

    Read the article

  • Active Mailer doesn't have the application helpers when used with delayed_job v.2

    - by Savvas
    So if I try sending an email with action mailer directly, I can use all application helpers like url_for, content_for etc, but when I try to do the exact same action [sending email] with delayed_job [send_later] I getting a delayed job fail, of undefined function content_for etc, so it is like no helpers are loaded in my ActionMailer. I am using rails 2.3.8, active_mailer 2.3.8 and delayed_job 2.0.3 Thanks!!

    Read the article

  • Action Mailer Confirmation Emails - Ruby on Rails...

    - by bgadoci
    I have successfully installed the Clearance Gem from ThoughtBot. Clearance sends a confirmation email upon a new sign_up and suggests adding: config.action_mailer.default_url_options = { :host => 'localhost:3000' } to your /environments/test.rb and development.rb. I have tried this and also config.action_mailer.default_url_options = { :host => '127.0.0.1', :port => 3000 } But can't seem to get rails to send the email. As I am new to both Ruby and Rails, I am wondering if there is some step/config that ThoughtBot is assuming I have already done to send emails. What am I doing wrong/missing? UPDATE: Just added notifier.rb class Notifier < ActionMailer::Base recipients recipient.email_address_with_name bcc ["[email protected]"] from "[email protected]" subject "New account information" body :account => recipient end end

    Read the article

  • Sending a signup confirmation email with having to confirm using Devise

    - by slythic
    Hi all, I'm using devise to handle user authentication with my rails app. I'd like to allow my users to sign up and be instantly logged in and receive a confirmation email. Devise has the Confirmable module which sends out an email but requires the user to open up their mail application, find the email and click a link which then leads them to the site again. I'd like to just email the user a confirmation that they signed up and that's it. Is there a way for devise to do this or do I need to resolve to handling ActionMailer myself (if so, is there a quick and non-complex example)? Many thanks! -Tony

    Read the article

  • Devise email confirmation from localhost

    - by John
    I am able to get the registration confirmation email to send out in deployment on Heroku, but when I try a registration on localhost:3000, I get the following error: undefined local variable or method `confirmed_at' for #<User:0xb67a1ff0> In my config/environments/production.rb file I have: config.action_mailer.default_url_options = { :host => 'xxxx.com' } And I have an initializer file with the following format: ActionMailer::Base.smtp_settings = { :user_name => "[email protected]", :password => "xxxxxx", :domain => "xxxx.com", :address => "smtp.sendgrid.net", :port => "xxx", :authentication => :plain, :enable_starttls_auto => true }; What settings do I need to get the localhost working? Thanks! John

    Read the article

  • Ruby mailer is coming up with an EOFError

    - by Deadder
    I am getting an EOFError (End Of File Error) on this code in my controller. The block where the error appears is at the end of the line that says UserMailer.deliver_message( I am unaware as to how to fix this, I have been stuck for about 2 months and this site was suggested. Please help. def contact @title= "Contact Us" if request.post? @message= Message.new(params[:contact]) if @message.valid? UserMailer.deliver_message( :message => @message ) flash[:notice] = "Thank you for contacting us" redirect_to contact_url end end end Here is the message file: <%= @mail.name %> has sent feedback or a question: Message: <%= @mail.body %> From: <%= @mail.email %> And here is the UserMailer class UserMailer < ActionMailer::Base def message(mail) subject 'Feedback/Questions' recipients 'Email@email' from 'webmaster' body mail end end

    Read the article

  • Ruby On Rails - Contact form not sending email via localhost

    - by anonymousxxx
    similar problem Rails contact form not working guides: https://github.com/thomasklemm/email_form_rails rails 3.2.x app\models\message.rb class Message include ActiveAttr::Model include ActiveModel::Validations attribute :name attribute :email attribute :subject attribute :body attr_accessible :name, :email, :subject, :body validates_presence_of :name validates_presence_of :email validates :email, email_format: { message: "is not looking like a valid email address"} validates_presence_of :subject validates_length_of :body, maximum: 500 end app\mailers\contact_form.rb class ContactForm < ActionMailer::Base default from: "[email protected]" default to: "[email protected]" def email_form(message) @message = message mail subject: "#{message.subject} #{message.name}" mail body: "#{message.body}" end end development.rb config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "mydomain.com", :user_name => "[email protected]", :password => "mypassword", :authentication => :plain, :enable_starttls_auto => true } config.action_mailer.default_url_options = { :host => "localhost:3000" } output in command Started POST "/email" for 127.0.0.1 at 2012-09-04 22:10:40 +0700 Processing by HomeController#send_email_form as HTML Parameters: {"utf8"="v", "authenticity_token"="w39BLqCrjTMm4RRi/Sm5hZoEpcw46 npyRy/RS0h48x0=", "message"={"name"="anonymousxxx", "email"="[email protected]", "subject"="Test", "body"="send email"}, "commit"="Create Message"} Redirected to localhost:3000/home/contact Completed 302 Found in 1ms (ActiveRecord: 0.0ms) but email (message) no receive my email,..

    Read the article

  • Action Mailer: How do I render dynamic data in an email body that is stored in the database?

    - by Brandon Toone
    I have Action Mailer setup to render an email using the body attribute of my Email model (in the database). I want to be able to use erb in the body but I can't figure out how to get it to render in the sent email message. I'm able to get the body as a string with this code # models/user_mailer.rb def custom_email(user, email_id) email = Email.find(email_id) recipients user.email from "Mail It Example <[email protected]>" subject "Hello From Mail It" sent_on Time.now # pulls the email body and passes a string to the template views/user_mailer/customer_email.text.html.erb body :msg => email.body end I came across this article http://rails-nutshell.labs.oreilly.com/ch05.html which says I can use render but I'm only able to get render :text to work and not render :inline # models/user_mailer.rb def custom_email(user, email_id) email = Email.find(email_id) recipients user.email from "Mail It Example <[email protected]>" subject "Hello From Mail It" sent_on Time.now # body :msg => email.body body :msg => (render :text => "Thanks for your order") # renders text and passes as a variable to the template # body :msg => (render :inline => "We shipped <%= Time.now %>") # throws a NoMethodError end

    Read the article

  • Using Routing helpers in a Rake task

    - by trobrock
    I have a rake task that sends out the next 'x' invitations to join a beta it uses this code: desc "This will send out the next batch of invites for the beta" task :send_invites => :environment do limit = ENV['limit'] c = 0 invitation = Invitation.all(:conditions => { :sent_at => nil, :sender_id => nil }, :limit => limit).each do |i| Mailer.deliver_invitation(i, register_url(i.token)) c.increment! end puts "Sent #{c} invitations." end I need to pass in the 'register_url' to the Mailer in order for the link to show up in the email, but since this is running from a rake task and not from a request it does not have a access to the helper methods. What is the best way of achieving this?

    Read the article

  • Strange Email Activity Ruby on Rails

    - by Stranger
    Environment.rb ActionMailer::Base.delivery_method = :sendmail ActionMailer::Base.sendmail_settings = { :address = "mail.example.org", :domain = "example.org", :port = 25, :authentication = :login, :user_name = "email+email.org", :password = "password" } ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.default_charset = "utf-8" Development.log Sent mail to [email protected] Date: Sat, 17 Apr 2010 19:38:08 -0500 From: example.org To: [email protected] Subject: Hello Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 The process of sending email is ok but when I check my email I didn't recive any. What seems to be wrong?

    Read the article

  • Customize the From address in Rails application

    - by palani
    Hi , I have mailer action in my application, the mailer is configured with gmail smtp. The following is my config details under environment.rb file require "smtp_tls" ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.default_charset = "utf-8" ActionMailer::Base.default_content_type = "text/html" ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => 'gmail.com', :user_name => "[email protected]", :password => "password", :authentication => :plain The think i want to implement is, when ever the application generating email the from address shows "[email protected]". Is possible to customize the from address. In different places i want to use different From address instead of "[email protected]" I tried with my mailer model: @from = "#{user.email}" In development server log it shows the customized id correctly. if go my email inbox it shows the from address as "[email protected]" Can any one please guide on this. thanks in advance.

    Read the article

  • Email sent by ActionMailer is taking six hours to deliver mail.

    - by grg-n-sox
    So I have been asked to help maintain a website that uses Ruby on Rails. Now, let me just say I've been programming Ruby for awhile but I am still new to Rails. The first problem brought to my attention is how the activation email takes about six hours to arrive. It would be one thing if the email was not being sent due to errors but it is being send correctly, just slow. Also the server this is running on is also its own SMTP. I checked how the email was being formatted before calling the setup_email method and everything looks okay. I even dug into the ActionMailer lib and read through the files there and didn't see anything out of the ordinary. So what is most likely causing the email to take six hours to deliver?

    Read the article

  • Disturbing Ruby on Rails Behavior

    - by User
    Environment.rb ActionMailer::Base.delivery_method = :sendmail ActionMailer::Base.sendmail_settings = { :address => "mail.example.org", :domain => "example.org", :port => 25, :authentication => :login, :user_name => "email+email.org", :password => "password" } ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.default_charset = "utf-8" Development.log Sent mail to [email protected] Date: Sat, 17 Apr 2010 19:38:08 -0500 From: example.org To: [email protected] Subject: Hello Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 The process of sending email is ok but when I check my email I didn't recive any. What seems to be wrong?

    Read the article

  • User Mailer Failing

    - by Trevor Nederlof
    I have setup a process in my User model to send a bunch of @users to a mailing script, user_mailer.rb I am using the http://postageapp.com app to send out emails. The users are getting to the User_mailer but I am getting an error from there. Can anyone please point me in the right direction. User Model: class User < ActiveRecord::Base acts_as_authentic def self.mail_out weekday = Date.today.strftime('%A').downcase @users = find(:all, :conditions => {"#{weekday}sub".to_sym => 't'}) UserMailer.deliver_mail_out(@users) end end User_mailer.rb class UserMailer < ActionMailer::Base def mail_out(users) @recipients = { } users.each do |user| @recipients[user.email] = { :zipcode => user.zipcode } end from "[email protected]" subject "Check out the trailer of the day!" body :user => user end end mail_out.html.erb {{zipcode}}, Please check out the trailer of the day at http://www.dailytrailer.net Thank you! -- The DailyTrailer.net Team User db schema create_table "users", :force => true do |t| t.string "email" t.date "birthday" t.string "gender" t.string "zipcode" t.datetime "created_at" t.datetime "updated_at" t.string "crypted_password" t.string "password_salt" t.string "persistence_token" t.string "mondaysub", :default => "f", :null => false t.string "tuesdaysub", :default => "f", :null => false t.string "wednesdaysub", :default => "f", :null => false t.string "thursdaysub", :default => "f", :null => false t.string "fridaysub", :default => "f", :null => false t.string "saturdaysub", :default => "f", :null => false t.string "sundaysub", :default => "f", :null => false end Error: /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48: undefined method `name' for #<User:0xb6e8ae48> (NoMethodError) from /home/tnederlof/Dropbox/Ruby/daily_trailer/app/models/user_mailer.rb:5:in `mail_out' from /home/tnederlof/Dropbox/Ruby/daily_trailer/app/models/user_mailer.rb:4:in `each' from /home/tnederlof/Dropbox/Ruby/daily_trailer/app/models/user_mailer.rb:4:in `mail_out' from /home/tnederlof/.gem/ruby/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:459:in `__send__' from /home/tnederlof/.gem/ruby/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:459:in `create!' from /home/tnederlof/.gem/ruby/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:452:in `initialize' from /home/tnederlof/.gem/ruby/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:395:in `new' from /home/tnederlof/.gem/ruby/1.8/gems/actionmailer-2.3.5/lib/action_mailer/base.rb:395:in `method_missing' from /home/tnederlof/Dropbox/Ruby/daily_trailer/app/models/user.rb:13:in `mail_out' from (eval):1 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `eval' from /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:48 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/runner:3

    Read the article

  • Problem with ar_mailer

    - by Roberto
    Hi guys, I'm running a strange problem sending emails. Basicly I'm getting this exception: ArgumentError (wrong number of arguments (1 for 0)): /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:642:in `initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:642:in `new' /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:642:in `create' /usr/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_mailer.rb:92:in `perform_delivery_activerecord' /usr/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_mailer.rb:91:in `each' /usr/lib/ruby/gems/1.8/gems/ar_mailer-1.3.1/lib/action_mailer/ar_mailer.rb:91:in `perform_delivery_activerecord' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer/base.rb:508:in `__send__' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer/base.rb:508:in `deliver!' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.1.1/lib/action_mailer/base.rb:383:in `method_missing' /app/controllers/web_reservations_controller.rb:29:in `test_email' In my web_reservations_controller I have a simply method calling TestMailer.deliver_send_email And my TesMailer is something like: class TestMailer < ActionMailer::ARMailer def send_email @recipients = "[email protected]" @from = "[email protected]" @subject = "TEST MAIL SUBJECT" @body = "<br>TEST MAIL MESSAGE" @content_type = "text/html" end end Do you have any idea? Thanks! Roberto

    Read the article

  • Cannot send e-mail with rails 2.3.4(I could with 2.3.2)

    - by Brian Roisentul
    I'm working with ruby on rails 2.3.4 and I yesterday I found out I cannot send emails any more. The email-related credentials are ok because I could send emails until I upgraded my rails version about two weeks ago. The error message I get is the following: ArgumentError in UsersController#create wrong # of arguments(3 for 2) D:/Proyectos/Cursometro/www/vendor/plugins/action_mailer_tls/lib/smtp_tls.rb:8:in `check_auth_args' D:/Proyectos/Cursometro/www/vendor/plugins/action_mailer_tls/lib/smtp_tls.rb:8:in `do_start' C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/net/smtp.rb:525:in `start' C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:682:in `perform_delivery_smtp' C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `deliver!' C:/Program Files (x86)/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:395:in `method_missing' D:/Proyectos/Cursometro/www/app/models/user_observer.rb:3:in `after_create' D:/Proyectos/Cursometro/www/app/controllers/users_controller.rb:221:in `create_new_user' D:/Proyectos/Cursometro/www/app/controllers/users_controller.rb:101:in `create' Please, help!

    Read the article

  • Bundler isn't loading gems

    - by Garrett
    I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I defined my Gemfile like so: clear_sources source "http://gemcutter.org" source "http://gems.github.com" bundle_path "vendor/bundler_gems" ## Bundle edge rails: git "git://github.com/rails/arel.git" git "git://github.com/rails/rack.git" gem "rails", :git => "git://github.com/rails/rails.git" ## Bundle gem "mongo_mapper", :git => "git://github.com/jnunemaker/mongomapper.git" gem "bluecloth", ">= 2.0.0" Then I run gem bundle, it bundles it all up like expected. Inside the environment.rb file that is included within boot.rb it looks like this: # DO NOT MODIFY THIS FILE module Bundler file = File.expand_path(__FILE__) dir = File.dirname(file) ENV["PATH"] = "#{dir}/../../../../bin:#{ENV["PATH"]}" ENV["RUBYOPT"] = "-r#{file} #{ENV["RUBYOPT"]}" $LOAD_PATH.unshift File.expand_path("#{dir}/gems/builder-2.1.2/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/builder-2.1.2/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/text-hyphen-1.0.0/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/text-hyphen-1.0.0/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/i18n-0.3.3/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/i18n-0.3.3/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/arel/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/arel/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activemodel/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activemodel/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/jnunemaker-validatable-1.8.1/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/jnunemaker-validatable-1.8.1/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/abstract-1.0.0/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/abstract-1.0.0/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/erubis-2.6.5/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/erubis-2.6.5/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/mime-types-1.16/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/mime-types-1.16/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/mail-2.1.2/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/mail-2.1.2/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rake-0.8.7/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rake-0.8.7/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/railties/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/railties/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/memcache-client-1.7.7/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/memcache-client-1.7.7/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rack/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rack/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rack-test-0.5.3/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rack-test-0.5.3/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rack-mount-0.4.5/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/rack-mount-0.4.5/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/actionpack/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/actionpack/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/bluecloth-2.0.7/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/bluecloth-2.0.7/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/bluecloth-2.0.7/ext") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activerecord/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activerecord/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/text-format-1.0.0/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/text-format-1.0.0/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/actionmailer/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/actionmailer/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/tzinfo-0.3.16/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/tzinfo-0.3.16/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activesupport/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activesupport/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activeresource/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/activeresource/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/rails/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/mongo-0.18.2/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/gems/mongo-0.18.2/lib") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/mongomapper/bin") $LOAD_PATH.unshift File.expand_path("#{dir}/dirs/mongomapper/lib") @gemfile = "#{dir}/../../../../Gemfile" require "rubygems" unless respond_to?(:gem) # 1.9 already has RubyGems loaded @bundled_specs = {} @bundled_specs["builder"] = eval(File.read("#{dir}/specifications/builder-2.1.2.gemspec")) @bundled_specs["builder"].loaded_from = "#{dir}/specifications/builder-2.1.2.gemspec" @bundled_specs["text-hyphen"] = eval(File.read("#{dir}/specifications/text-hyphen-1.0.0.gemspec")) @bundled_specs["text-hyphen"].loaded_from = "#{dir}/specifications/text-hyphen-1.0.0.gemspec" @bundled_specs["i18n"] = eval(File.read("#{dir}/specifications/i18n-0.3.3.gemspec")) @bundled_specs["i18n"].loaded_from = "#{dir}/specifications/i18n-0.3.3.gemspec" @bundled_specs["arel"] = eval(File.read("#{dir}/specifications/arel-0.2.pre.gemspec")) @bundled_specs["arel"].loaded_from = "#{dir}/specifications/arel-0.2.pre.gemspec" @bundled_specs["activemodel"] = eval(File.read("#{dir}/specifications/activemodel-3.0.pre.gemspec")) @bundled_specs["activemodel"].loaded_from = "#{dir}/specifications/activemodel-3.0.pre.gemspec" @bundled_specs["jnunemaker-validatable"] = eval(File.read("#{dir}/specifications/jnunemaker-validatable-1.8.1.gemspec")) @bundled_specs["jnunemaker-validatable"].loaded_from = "#{dir}/specifications/jnunemaker-validatable-1.8.1.gemspec" @bundled_specs["abstract"] = eval(File.read("#{dir}/specifications/abstract-1.0.0.gemspec")) @bundled_specs["abstract"].loaded_from = "#{dir}/specifications/abstract-1.0.0.gemspec" @bundled_specs["erubis"] = eval(File.read("#{dir}/specifications/erubis-2.6.5.gemspec")) @bundled_specs["erubis"].loaded_from = "#{dir}/specifications/erubis-2.6.5.gemspec" @bundled_specs["mime-types"] = eval(File.read("#{dir}/specifications/mime-types-1.16.gemspec")) @bundled_specs["mime-types"].loaded_from = "#{dir}/specifications/mime-types-1.16.gemspec" @bundled_specs["mail"] = eval(File.read("#{dir}/specifications/mail-2.1.2.gemspec")) @bundled_specs["mail"].loaded_from = "#{dir}/specifications/mail-2.1.2.gemspec" @bundled_specs["rake"] = eval(File.read("#{dir}/specifications/rake-0.8.7.gemspec")) @bundled_specs["rake"].loaded_from = "#{dir}/specifications/rake-0.8.7.gemspec" @bundled_specs["railties"] = eval(File.read("#{dir}/specifications/railties-3.0.pre.gemspec")) @bundled_specs["railties"].loaded_from = "#{dir}/specifications/railties-3.0.pre.gemspec" @bundled_specs["memcache-client"] = eval(File.read("#{dir}/specifications/memcache-client-1.7.7.gemspec")) @bundled_specs["memcache-client"].loaded_from = "#{dir}/specifications/memcache-client-1.7.7.gemspec" @bundled_specs["rack"] = eval(File.read("#{dir}/specifications/rack-1.1.0.gemspec")) @bundled_specs["rack"].loaded_from = "#{dir}/specifications/rack-1.1.0.gemspec" @bundled_specs["rack-test"] = eval(File.read("#{dir}/specifications/rack-test-0.5.3.gemspec")) @bundled_specs["rack-test"].loaded_from = "#{dir}/specifications/rack-test-0.5.3.gemspec" @bundled_specs["rack-mount"] = eval(File.read("#{dir}/specifications/rack-mount-0.4.5.gemspec")) @bundled_specs["rack-mount"].loaded_from = "#{dir}/specifications/rack-mount-0.4.5.gemspec" @bundled_specs["actionpack"] = eval(File.read("#{dir}/specifications/actionpack-3.0.pre.gemspec")) @bundled_specs["actionpack"].loaded_from = "#{dir}/specifications/actionpack-3.0.pre.gemspec" @bundled_specs["bluecloth"] = eval(File.read("#{dir}/specifications/bluecloth-2.0.7.gemspec")) @bundled_specs["bluecloth"].loaded_from = "#{dir}/specifications/bluecloth-2.0.7.gemspec" @bundled_specs["activerecord"] = eval(File.read("#{dir}/specifications/activerecord-3.0.pre.gemspec")) @bundled_specs["activerecord"].loaded_from = "#{dir}/specifications/activerecord-3.0.pre.gemspec" @bundled_specs["text-format"] = eval(File.read("#{dir}/specifications/text-format-1.0.0.gemspec")) @bundled_specs["text-format"].loaded_from = "#{dir}/specifications/text-format-1.0.0.gemspec" @bundled_specs["actionmailer"] = eval(File.read("#{dir}/specifications/actionmailer-3.0.pre.gemspec")) @bundled_specs["actionmailer"].loaded_from = "#{dir}/specifications/actionmailer-3.0.pre.gemspec" @bundled_specs["tzinfo"] = eval(File.read("#{dir}/specifications/tzinfo-0.3.16.gemspec")) @bundled_specs["tzinfo"].loaded_from = "#{dir}/specifications/tzinfo-0.3.16.gemspec" @bundled_specs["activesupport"] = eval(File.read("#{dir}/specifications/activesupport-3.0.pre.gemspec")) @bundled_specs["activesupport"].loaded_from = "#{dir}/specifications/activesupport-3.0.pre.gemspec" @bundled_specs["activeresource"] = eval(File.read("#{dir}/specifications/activeresource-3.0.pre.gemspec")) @bundled_specs["activeresource"].loaded_from = "#{dir}/specifications/activeresource-3.0.pre.gemspec" @bundled_specs["rails"] = eval(File.read("#{dir}/specifications/rails-3.0.pre.gemspec")) @bundled_specs["rails"].loaded_from = "#{dir}/specifications/rails-3.0.pre.gemspec" @bundled_specs["mongo"] = eval(File.read("#{dir}/specifications/mongo-0.18.2.gemspec")) @bundled_specs["mongo"].loaded_from = "#{dir}/specifications/mongo-0.18.2.gemspec" @bundled_specs["mongo_mapper"] = eval(File.read("#{dir}/specifications/mongo_mapper-0.6.10.gemspec")) @bundled_specs["mongo_mapper"].loaded_from = "#{dir}/specifications/mongo_mapper-0.6.10.gemspec" def self.add_specs_to_loaded_specs Gem.loaded_specs.merge! @bundled_specs end def self.add_specs_to_index @bundled_specs.each do |name, spec| Gem.source_index.add_spec spec end end add_specs_to_loaded_specs add_specs_to_index def self.require_env(env = nil) context = Class.new do def initialize(env) @env = env && env.to_s ; end def method_missing(*) ; yield if block_given? ; end def only(*env) old, @only = @only, _combine_only(env.flatten) yield @only = old end def except(*env) old, @except = @except, _combine_except(env.flatten) yield @except = old end def gem(name, *args) opt = args.last.is_a?(Hash) ? args.pop : {} only = _combine_only(opt[:only] || opt["only"]) except = _combine_except(opt[:except] || opt["except"]) files = opt[:require_as] || opt["require_as"] || name files = [files] unless files.respond_to?(:each) return unless !only || only.any? {|e| e == @env } return if except && except.any? {|e| e == @env } if files = opt[:require_as] || opt["require_as"] files = Array(files) files.each { |f| require f } else begin require name rescue LoadError # Do nothing end end yield if block_given? true end private def _combine_only(only) return @only unless only only = [only].flatten.compact.uniq.map { |o| o.to_s } only &= @only if @only only end def _combine_except(except) return @except unless except except = [except].flatten.compact.uniq.map { |o| o.to_s } except |= @except if @except except end end context.new(env && env.to_s).instance_eval(File.read(@gemfile), @gemfile, 1) end end module Gem @loaded_stacks = Hash.new { |h,k| h[k] = [] } def source_index.refresh! super Bundler.add_specs_to_index end end But when I try to access any of my gems, e.g. MongoMapper, Paperclip, Haml, etc. I get: NameError: uninitialized constant MongoMapper The same goes for any other gem. Does Bundler not include gems like the old Rails 2.0 did? Or is something messed up with my system? Any help would be appreciated, thank you!

    Read the article

  • Upgrading Redmine, activerecord-mysql2-adapter not recognized

    - by David Kaczynski
    For upgrading Redmine from 1.0.1 to 2.1.2, I need to execute the command: rake db:migrate RAILS_ENV=production However, doing so produces the following error: rake aborted! Please install the mysql2 adapter: gem install activerecord-mysql2-adapter (mysql2 is not part of the bundle. Add it to Gemfile.) I have ran gem install activerecord-mysql2-adapter, but I still get the same error when I try to run the rake ... command. How do I get my RoR app to recognize that I have the mysql2 adapter installed already? or Is there something wrong with my activerecord-mysql2-adapter installation? Results of sudo bundle install: Using rake (10.0.0) Using i18n (0.6.1) Using multi_json (1.3.7) Using activesupport (3.2.8) Using builder (3.0.0) Using activemodel (3.2.8) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.3) Using actionpack (3.2.8) Using mime-types (1.19) Using polyglot (0.3.3) Using treetop (1.4.12) Using mail (2.4.4) Using actionmailer (3.2.8) Using arel (3.0.2) Using tzinfo (0.3.35) Using activerecord (3.2.8) Using activeresource (3.2.8) Using coderay (1.0.8) Using fastercsv (1.5.5) Using rack-ssl (1.3.2) Using json (1.7.5) Using rdoc (3.12) Using thor (0.16.0) Using railties (3.2.8) Using jquery-rails (2.0.3) Using metaclass (0.0.1) Using mocha (0.12.3) Using mysql (2.8.1) Using net-ldap (0.3.1) Using pg (0.14.1) Using ruby-openid (2.1.8) Using rack-openid (1.3.1) Using bundler (1.2.1) Using rails (3.2.8) Using rmagick (2.13.1) Using shoulda (2.11.3) Using sqlite3 (1.3.6) Using yard (0.8.3) [32mYour bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.[0m Results of sudo find / -name "*mysql2*": /var/lib/gems/1.8/doc/mysql2-0.3.11 /var/lib/gems/1.8/doc/activerecord-3.2.9/ri/ActiveRecord/Base/mysql2_connection-c.ri /var/lib/gems/1.8/doc/activerecord-mysql2-adapter-0.0.3 /var/lib/gems/1.8/doc/activerecord-mysql2-adapter-0.0.3/ri/ActiveRecord/Base/em_mysql2_connection-c.ri /var/lib/gems/1.8/doc/activerecord-mysql2-adapter-0.0.3/ri/ActiveRecord/Base/mysql2_connection-c.ri /var/lib/gems/1.8/gems/mysql2-0.3.11 /var/lib/gems/1.8/gems/mysql2-0.3.11/spec/mysql2 /var/lib/gems/1.8/gems/mysql2-0.3.11/mysql2.gemspec /var/lib/gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb /var/lib/gems/1.8/gems/mysql2-0.3.11/lib/mysql2 /var/lib/gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.so /var/lib/gems/1.8/gems/mysql2-0.3.11/ext/mysql2 /var/lib/gems/1.8/gems/mysql2-0.3.11/ext/mysql2/mysql2.so /var/lib/gems/1.8/gems/mysql2-0.3.11/ext/mysql2/mysql2_ext.c /var/lib/gems/1.8/gems/mysql2-0.3.11/ext/mysql2/mysql2_ext.h /var/lib/gems/1.8/gems/mysql2-0.3.11/ext/mysql2/mysql2_ext.o /var/lib/gems/1.8/gems/activerecord-3.2.9/lib/active_record/connection_adapters/mysql2_adapter.rb /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3 /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3/activerecord-mysql2-adapter.gemspec /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3/lib/arel/engines/sql/compilers/mysql2_compiler.rb /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3/lib/activerecord-mysql2-adapter.rb /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3/lib/activerecord-mysql2-adapter /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3/lib/active_record/connection_adapters/em_mysql2_adapter.rb /var/lib/gems/1.8/gems/activerecord-mysql2-adapter-0.0.3/lib/active_record/connection_adapters/mysql2_adapter.rb /var/lib/gems/1.8/gems/activerecord-3.2.8/lib/active_record/connection_adapters/mysql2_adapter.rb /var/lib/gems/1.8/cache/mysql2-0.3.11.gem /var/lib/gems/1.8/cache/activerecord-mysql2-adapter-0.0.3.gem /var/lib/gems/1.8/specifications/activerecord-mysql2-adapter-0.0.3.gemspec /var/lib/gems/1.8/specifications/mysql2-0.3.11.gemspec Contents of /usr/share/redmine/Gemfile: source 'http://rubygems.org' gem 'rails', '3.2.8' gem "jquery-rails", "~> 2.0.2" gem "i18n", "~> 0.6.0" gem "coderay", "~> 1.0.6" gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby] gem "builder", "3.0.0" # Optional gem for LDAP authentication group :ldap do gem "net-ldap", "~> 0.3.1" end # Optional gem for OpenID authentication group :openid do gem "ruby-openid", "~> 2.1.4", :require => "openid" gem "rack-openid" end # Optional gem for exporting the gantt to a PNG file, not supported with jruby platforms :mri, :mingw do group :rmagick do # RMagick 2 supports ruby 1.9 # RMagick 1 would be fine for ruby 1.8 but Bundler does not support # different requirements for the same gem on different platforms gem "rmagick", ">= 2.0.0" end end # Database gems platforms :mri, :mingw do group :postgresql do gem "pg", ">= 0.11.0" end group :sqlite do gem "sqlite3" end end platforms :mri_18, :mingw_18 do group :mysql do gem "mysql" end end platforms :mri_19, :mingw_19 do group :mysql do gem "mysql2", "~> 0.3.11" end end platforms :jruby do gem "jruby-openssl" group :mysql do gem "activerecord-jdbcmysql-adapter" end group :postgresql do gem "activerecord-jdbcpostgresql-adapter" end group :sqlite do gem "activerecord-jdbcsqlite3-adapter" end end group :development do gem "rdoc", ">= 2.4.2" gem "yard" end group :test do gem "shoulda", "~> 2.11" # Shoulda does not work nice on Ruby 1.9.3 and seems to need test-unit explicitely. gem "test-unit", :platforms => [:mri_19] gem "mocha", "0.12.3" end local_gemfile = File.join(File.dirname(__FILE__), "Gemfile.local") if File.exists?(local_gemfile) puts "Loading Gemfile.local ..." if $DEBUG # `ruby -d` or `bundle -v` instance_eval File.read(local_gemfile) end # Load plugins' Gemfiles Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file| puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v` instance_eval File.read(file) end Contents of /usr/share/redmine/Gemfile.lock: GEM remote: http://rubygems.org/ specs: actionmailer (3.2.8) actionpack (= 3.2.8) mail (~> 2.4.4) actionpack (3.2.8) activemodel (= 3.2.8) activesupport (= 3.2.8) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) rack (~> 1.4.0) rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.1.3) activemodel (3.2.8) activesupport (= 3.2.8) builder (~> 3.0.0) activerecord (3.2.8) activemodel (= 3.2.8) activesupport (= 3.2.8) arel (~> 3.0.2) tzinfo (~> 0.3.29) activeresource (3.2.8) activemodel (= 3.2.8) activesupport (= 3.2.8) activesupport (3.2.8) i18n (~> 0.6) multi_json (~> 1.0) arel (3.0.2) builder (3.0.0) coderay (1.0.8) erubis (2.7.0) fastercsv (1.5.5) hike (1.2.1) i18n (0.6.1) journey (1.0.4) jquery-rails (2.0.3) railties (>= 3.1.0, < 5.0) thor (~> 0.14) json (1.7.5) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) mocha (0.12.3) metaclass (~> 0.0.1) multi_json (1.3.7) mysql (2.8.1) mysql2 (0.3.11) net-ldap (0.3.1) pg (0.14.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) rack (>= 0.4) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) rack-ssl (1.3.2) rack rack-test (0.6.2) rack (>= 1.0) rails (3.2.8) actionmailer (= 3.2.8) actionpack (= 3.2.8) activerecord (= 3.2.8) activeresource (= 3.2.8) activesupport (= 3.2.8) bundler (~> 1.0) railties (= 3.2.8) railties (3.2.8) actionpack (= 3.2.8) activesupport (= 3.2.8) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) rake (10.0.0) rdoc (3.12) json (~> 1.4) rmagick (2.13.1) ruby-openid (2.1.8) shoulda (2.11.3) sprockets (2.1.3) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.6) test-unit (2.5.2) thor (0.16.0) tilt (1.3.3) treetop (1.4.12) polyglot polyglot (>= 0.3.1) tzinfo (0.3.35) yard (0.8.3) PLATFORMS ruby DEPENDENCIES activerecord-jdbcmysql-adapter activerecord-jdbcpostgresql-adapter activerecord-jdbcsqlite3-adapter builder (= 3.0.0) coderay (~> 1.0.6) fastercsv (~> 1.5.0) i18n (~> 0.6.0) jquery-rails (~> 2.0.2) jruby-openssl mocha (= 0.12.3) mysql mysql2 (~> 0.3.11) net-ldap (~> 0.3.1) pg (>= 0.11.0) rack-openid rails (= 3.2.8) rdoc (>= 2.4.2) rmagick (>= 2.0.0) ruby-openid (~> 2.1.4) shoulda (~> 2.11) sqlite3 test-unit yard Results of gem list: actionmailer (3.2.9, 3.2.8) actionpack (3.2.9, 3.2.8) activemodel (3.2.9, 3.2.8) activerecord (3.2.9, 3.2.8) activerecord-mysql2-adapter (0.0.3) activeresource (3.2.9, 3.2.8) activesupport (3.2.9, 3.2.8) arel (3.0.2) builder (3.0.0) bundler (1.2.1) coderay (1.0.8) erubis (2.7.0) fastercsv (1.5.5) hike (1.2.1) i18n (0.6.1) journey (1.0.4) jquery-rails (2.0.3) json (1.7.5) mail (2.4.4) metaclass (0.0.1) mime-types (1.19) mocha (0.12.3) multi_json (1.3.7) mysql (2.8.1) mysql2 (0.3.11) net-ldap (0.3.1) pg (0.14.1) polyglot (0.3.3) rack (1.4.1) rack-cache (1.2) rack-openid (1.3.1) rack-ssl (1.3.2) rack-test (0.6.2) rails (3.2.9, 3.2.8) railties (3.2.9, 3.2.8) rake (10.0.0) rdoc (3.12) rmagick (2.13.1) ruby-openid (2.1.8) shoulda (2.11.3) sprockets (2.2.1, 2.1.3) sqlite3 (1.3.6) thor (0.16.0) tilt (1.3.3) treetop (1.4.12) tzinfo (0.3.35) yard (0.8.3) Results of 'bundle show`: Gems included by the bundle: * actionmailer (3.2.8) * actionpack (3.2.8) * activemodel (3.2.8) * activerecord (3.2.8) * activeresource (3.2.8) * activesupport (3.2.8) * arel (3.0.2) * builder (3.0.0) * bundler (1.2.1) * coderay (1.0.8) * erubis (2.7.0) * fastercsv (1.5.5) * hike (1.2.1) * i18n (0.6.1) * journey (1.0.4) * jquery-rails (2.0.3) * json (1.7.5) * mail (2.4.4) * metaclass (0.0.1) * mime-types (1.19) * mocha (0.12.3) * multi_json (1.3.7) * mysql (2.8.1) * net-ldap (0.3.1) * pg (0.14.1) * polyglot (0.3.3) * rack (1.4.1) * rack-cache (1.2) * rack-openid (1.3.1) * rack-ssl (1.3.2) * rack-test (0.6.2) * rails (3.2.8) * railties (3.2.8) * rake (10.0.0) * rdoc (3.12) * rmagick (2.13.1) * ruby-openid (2.1.8) * shoulda (2.11.3) * sprockets (2.1.3) * sqlite3 (1.3.6) * thor (0.16.0) * tilt (1.3.3) * treetop (1.4.12) * tzinfo (0.3.35) * yard (0.8.3)

    Read the article

  • Email Net::SMTPFatalError when sending email from Rails App

    - by Danny McClelland
    Hi Everyone, I have setup my application to send an email when a new case is created. if @kase.save UserMailer.deliver_contact_confirmation(@user) I have added the following to my user_mailer.rb def contact_confirmation(user) @subject = 'Message Subject' @body = "Message content" @from = "[email protected]" end but...when I create a new case and click submit I get the following: Net::SMTPFatalError in KasesController#create 555 5.5.2 Syntax error. x1sm110877wbx.1 I have added the SMTP details to the environment.rb as follows: ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :enable_starttls_auto => true, :address => "smtp.gmail.com", :port => "587", :domain => "XXXX.co.uk", :authentication => :plain, :user_name => "[email protected]", :password => "XXXX" } Any ideas? Thanks, Danny

    Read the article

  • CruiseControl.rb: Error in plugin EmailNotifier: 501 5.1.7 Bad sender address syntax?

    - by Justin
    Hi guys, I can't seem to figure this out. I setup my email address in cruisecontrol.rb but no matter how I set it, it always gives me this error. Current settings are: project/cruise_config.rb: project.email_notifier.emails = ['[email protected]'] project.email_notifier.from = '[email protected]' site_config.rb: ActionMailer::Base.smtp_settings = { :address => "localhost", :domain => "myemail.com", } I've even tried ActionMailer::Base.delivery_method = :sendmail Configuration.email_from = '[email protected]' Any thoughts as to why my cruisecontrol can't send an e-mail? Thanks! Justin

    Read the article

  • How do I create another controller action to create an object in rails?

    - by Angela
    I have a model called Contact_Email. When an Email template is sent through ActionMailer to a specific Contact, as part of the Create action it sends it through upon .save. However, I want to create a "skip" action which also creates a Contact_Email, but does NOT send an ActionMailer and allows me to set the status differently. I want to create a separate action because I want to make this respond to a remote_for_tag so that I can just have an ajax button indicate it has been "skipped": Here's what I tried, but while it creates a Contact_Email, I end up getting an error when I want to go back and view all the Contacts again. def skip @contact_email = ContactEmail.new @contact_email.contact_id = params[:contact_id] @contact_email.email_id = params[:email_id] @contact_email.status = "skipped" if @contact_email.save flash[:notice] = "skipped email" redirect_to contact_emails_url end end

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >