[Rails] E-Mail Header with SMTP Configuration
Hi everyone My app is sending mails with ActionMailer with smtp sending through google. When I set up the E-Mail I set the @from paramter @from= "Administrator <#{APP_CONFIG['admin_email']}>" But the emails are arriving only with "ad...@domain.com" and not "Administrator " does google prohibit configuration of email headers while sending them by it??? Or do I misunderstand anything else? Thanks in advance... -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Force app to use www only
Priyanka Pathak wrote: > Adam Meyer wrote: >> Hi everyone, >> >> I want to go live with my application. But something is wrong with my >> site when using www.domain.com or domain.com. It seems that it use >> different instances of the app and create different sessions. >> >> How can I configure my app to redirect to www.domain.com when someone >> calls domain.com? >> >> Thanks in advance >> >> Adam > > Hi, > In .htaccess you specify the rewrite url rule to redirect > domain.com to www.domain.com > Place below code in .htaccess > >RewriteEngine On >RewriteCond %{HTTP_HOST} !^www >RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301] > > Thanks, > Priyanka Pathak Thanks, I realized it with a .htaccess. The vhost configuration sent me in a loop. Cheers -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Force app to use www only
Hi everyone, I want to go live with my application. But something is wrong with my site when using www.domain.com or domain.com. It seems that it use different instances of the app and create different sessions. How can I configure my app to redirect to www.domain.com when someone calls domain.com? Thanks in advance Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Confusing routing behavior
I have it! It was because of # protected # def ssl_required? #ENV["RAILS_ENV"] == "production" # end in the image controller. But why? -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Confusing routing behavior
What happens in dev mode locally Processing ImagesController#create (for 127.0.0.1 at 2009-11-05 21:52:27) [POST] Session ID: 2e54b69d91dafe551b5edabc637c019b Parameters: {"x"=>"52", "y"=>"21", "action"=>"create", "authenticity_token"=>"4221d581c4a9acc11ef32170b788078b70b3e282", "controller"=>"images", "image"=>{"uploaded_data"=>#}} [4;36;1mImage Create (11.8ms) [0m[0;1mINSERT INTO "images" ("name", "size", "created_at", "content_type", "kwiker_id", "thumbnail", "category_id", "filename", "height", "parent_id", "width", "fake_sold", "real_sold") VALUES(NULL, 336787, '2009-11-05 21:52:30', 'image/png', 4100684228, NULL, NULL, 'c8e367cf60f5f85cd598a9c5c364def122066836.png', 565, NULL, 755, NULL, NULL) [0m [4;35;1mImage Load (0.7ms) [0m[0mSELECT * FROM "images" WHERE ("images"."thumbnail" = 'thumb' AND "images"."parent_id" = 67) LIMIT 1 [0m [4;36;1mImage Create (0.7ms) [0m[0;1mINSERT INTO "images" ("name", "size", "created_at", "content_type", "kwiker_id", "thumbnail", "category_id", "filename", "height", "parent_id", "width", "fake_sold", "real_sold") VALUES(NULL, 309301, '2009-11-05 21:52:30', 'image/png', NULL, 'thumb', NULL, 'c8e367cf60f5f85cd598a9c5c364def122066836_thumb.png', 112, 67, 150, NULL, NULL) [0m Redirected to /grusskarten/deinenachricht/67 Completed in 3076ms (DB: 14) | 302 Found [http://localhost/images/create] Processing GrusskartenController#deinenachricht (for 127.0.0.1 at 2009-11-05 21:52:31) [GET] Session ID: 2e54b69d91dafe551b5edabc637c019b Parameters: {"action"=>"deinenachricht", "id"=>"67", "controller"=>"grusskarten"} [4;35;1mOrder Load (0.2ms) [0m[0mSELECT * FROM "orders" WHERE (kwiker_id= 4100684228 AND status = 0) LIMIT As it should be... -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Confusing routing behavior
Hi everyone I have a strange routing behavior. And I don't know when it started being. I have a form for image upload using attachment_fu. The code in the view is <% form_for(:image, :url => "/images/create", :html => { :multipart => true }) do |form| %> <%= form.file_field :uploaded_data, :size => 15, :class => "formLoader" %> <% end %> and the controller code is def create # Used by start/index @image = Image.new(params[:image]) @image.kwiker_id = session[:kwiker] if @image.save redirect_to('/grusskarten/deinenachricht/' + @image.id.to_s) else flash[:error] = 'Das Bild konnte nicht hochgeladen werden.' redirect_to(:controller => 'start') end end so it should route me to /grusskarten/deinenachricht/ if succesful. But I run into a 404 error. The prod.log says Processing ImagesController#create (for 95.116.6.201 at 2009-11-05 21:38:20) [POST] Session ID: 33d68daef3fd8a51b3ec968b916ace06 Parameters: {"x"=>"70", "y"=>"23", "action"=>"create", "authenticity_token"=>"020d41a157fbc69c314d369d73f7dd47b9fe070f", "controller"=>"images", "image"=>{"uploaded_data"=>#https://test.kwikit.de/images/create Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected. Completed in 0ms (DB: 2) | 302 Found [http://test.kwikit.de/images/create] Processing ImagesController#show (for 95.116.6.201 at 2009-11-05 21:38:20) [GET] Session ID: 33d68daef3fd8a51b3ec968b916ace06 Parameters: {"action"=>"show", "id"=>"create", "controller"=>"images"} ActiveRecord::RecordNotFound (Couldn't find Image with ID=create): /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/base.rb: Why does he routes me to ImagesController and action => show? It happens only on my production server. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Sending Mails with mutations ä,ü ,ö
T. N.t. wrote: > Adam Meyer wrote: >> Hi everyone >> >> I am sending mails with rails in German. The Problem is that the German >> letters ä,ü,ö are arriving correctly at the receiver. >> >> When the subject contains the word >> >> Für >> >> the receiver gets >> >> Für >> >> Does anybody knows this issue? > > This is strange. ActionMailer (or is it TMail?) should encode this > correctly like =?utf-8?Q?=C3=84=C3=96=C3=9C?= (this is ÄÖÜ). For me it > does it very well. What version do you use and what is your code? > > Regards, T. I am riding on 2.2.2 with Actionmailer and my code is def invoice(kwiker, url, name) setup_email(kwiker) @subject+= 'Rechnung für Bestellung bei kwikit.de Grusskarten' @body[:url] = "http://#{APP_CONFIG['site_host']}/" part :content_type => "text/plain", :body => render_message("invoice.html.erb", body) attachment :content_type => "application/pdf", :body => File.read(url), :filename => name end and this is in my production.rb ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.perform_deliveries = true ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.default_charset = "utf-8" -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Sending Mails with mutations ä,ü,ö
Hi everyone I am sending mails with rails in German. The Problem is that the German letters ä,ü,ö are arriving correctly at the receiver. When the subject contains the word Für the receiver gets Für Does anybody knows this issue? Thanks in advance. Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: My App doesn't send mails
Adam Meyer wrote: > Thanks for all replies. I'll check it out and come back to you soon. It does run now. I fixed it with the website http://blog.inspired.no/smtp-error-while-using-gmail-in-rails-271 Thanks -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Routing Error if using ssl_required
Adam Meyer wrote: > Hi everyone, > > I am running into a routing error when activating ssl. > Everything works fine, when I put > > ssl_required :index > > into the controller I get a routing error > > Routing Error > > No route matches "/meinkwikit" with {:method=>:get} > > I installed the ssl plugin and putinclude SslRequirement into my > application_controller. > > Does anybody know what I am doing wrong? > > Thanks in advance > > Adam Solution: Server routed all *:443 requests to another rails app. Sorry. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: My App doesn't send mails
Tony Amoyal wrote: > These are my mail settings: > > config.action_mailer.delivery_method = :sendmail > config.action_mailer.raise_delivery_errors = true > > # Enable serving of images, stylesheets, and javascripts from an asset > server > # config.action_controller.asset_host = "http:// > assets.example.com" > > config.action_mailer.sendmail_settings = { > :location=> '/usr/sbin/sendmail', > :address => 'mail.mydomain.com', > :port=> 25, > :domain => 'www.mydomain.com', > :arguments => '-i -t' > > Check your production log after sending an email (you can do this > easily by tailing the log in one console and running the rails console > in another with the command "RAILS_ENV=production ruby script/ > console") > > Then just type in your ruby command to send an email and see what your > production log says. > > I had an issue where my emails were not being sent due to strict > policies with AOL. I debugged the issue using a tcp dump and tpick (i > am on ubuntu). > > to capture: > tcpdump -s 0 -i eth0 -w tcp_dump.pcap tcp port 25 > > ...assuming you are using port 25...then send your email and read the > pcap dump with > > tcpick -C -yP -r tcp_dump.pcap > > I am a bit of noob with debugging email but I did spend a couple days > doing it. Hope this helps. Hello again, I checked out a lot of different configuration. When I follow the instructions on http://guides.rubyonrails.org/action_mailer_basics.html and choose the sendmail conf. My production log tell me that the email was sent. But I do not get any email, even not in spam folder. when I try to take the gmail conf ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => 587, :domain => "domain.com", :user_name => "u...@domain.com", :password => "password", :authentication => :plain } with the action_mailer_tls plugin I get the following error ArgumentError in KwikersController#create wrong number of arguments (3 for 2) RAILS_ROOT: /Users/adam/Webs/kwikit/kwikit Application Trace | Framework Trace | Full Trace vendor/plugins/action_mailer_tls/lib/smtp_tls.rb:8:in `check_auth_args' vendor/plugins/action_mailer_tls/lib/smtp_tls.rb:8:in `do_start' /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/smtp.rb:525:in `start' /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:671:in `perform_delivery_smtp' /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:526:in `__send__' /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:526:in `deliver!' /Library/Ruby/Gems/1.8/gems/actionmailer-2.2.2/lib/action_mailer/base.rb:392:in `method_missing' app/models/kwiker.rb:142:in `do_pending' app/controllers/kwikers_controller.rb:45:in `create' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `send' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `perform_action_without_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in `call_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in `perform_action_without_caching' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache' /Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in `cache' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `send' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `process_without_filters' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_without_session_management_support' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process' /Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load_without_new_constant_marking' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:142:in `load' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in' /Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib
[Rails] Routing Error if using ssl_required
Hi everyone, I am running into a routing error when activating ssl. Everything works fine, when I put ssl_required :index into the controller I get a routing error Routing Error No route matches "/meinkwikit" with {:method=>:get} I installed the ssl plugin and putinclude SslRequirement into my application_controller. Does anybody know what I am doing wrong? Thanks in advance Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Select statements do not work on MySQL
Conrad Taylor wrote: > On Wed, Oct 14, 2009 at 12:28 AM, Adam Meyer < > rails-mailing-l...@andreas-s.net> wrote: > >> > you might need to contact your hosting support. >> > >> Obviously with my specific parts. >> It's really unbelivable. >> > > What happens when you attempt to access the database via the MySQL > client > program? For example > > mysql -u your-non-root-user -p your-non-root-password > your_database_development > > After connecting, try doing something like the following: > > select * from > > -Conrad Hey Conrad, I am at work now. Check it out when at home and come back to you. Cheers -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Select statements do not work on MySQL
Dhruva Sagar wrote: > No, what I meant was to check for the permissions of the database user > from > the database configurations.Not from rails side. From mysql there might > be > some configuration errors, some missing grant's or something, if you > can't > directly access those permission settings from some cpanel or something > then > you might need to contact your hosting support. > > This doesn't seem to be a problem from rails side in my knowledge. > > Thanks & Regards, > Dhruva Sagar. > > > Mike Ditka <http://www.brainyquote.com/quotes/authors/m/mike_ditka.html> > - > "If God had wanted man to play soccer, he wouldn't have given us arms." > > On Wed, Oct 14, 2009 at 12:46 PM, Adam Meyer < Yes, I know. I installed and configured the Production Server on my own. I set the grantt's as it is shown in this HowTo: CREATE DATABASE your_database_development; $ GRANT ALL PRIVILEGES ON your_database_development.* TO 'your-non-root-user'@'localhost' IDENTIFIED BY 'your-non-root-password'; Obviously with my specific parts. It's really unbelivable. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Select statements do not work on MySQL
Dhruva Sagar wrote: > Perhaps you should look up at the database user priviledges that you > have. > Thanks & Regards, > Dhruva Sagar. > > > Marie von > Ebner-Eschenbach<http://www.brainyquote.com/quotes/authors/m/marie_von_ebnereschenbac.html> > - "Even a stopped clock is right twice a day." > > On Wed, Oct 14, 2009 at 12:27 PM, Adam Meyer < Hey Dhruva, thanks for your reply. But it does not help. I used this HowTo to configure it. http://wiki.rubyonrails.org/database-support/mysql Even if I insert the root account information for the MySQL into the database.yml it does not work. :( -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Select statements do not work on MySQL
Hi everyone, I run into a problem after deploying my app to prod env on a Apache server with Passenger and MySQL5. The application works nearly fine, the only problem is that any select statements do not work on the database. For example if a user registers the app creates a new user entity in the user table. So creating entities does work good. But if I do a "User.find(1)" I get a nil back. And this happens at the complete app. Any find methtod (Select Statement) does work. Do anybody has an idea? I thought it is the encoding and I switched the mysql db and the app to UTF8 but it didn't help. Thanks in advance. Regards Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: My App doesn't send mails
Thanks for all replies. I'll check it out and come back to you soon. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] My App doesn't send mails
Hey everyone I put my developed app first time in production mode. Now I see that the Mails are not sent by the app. The strange think is, that it already sent mails in development environment. But only sometimes. How can I debug the mail sending by actionmailer? I have no idea where to start. Thanks in advance... Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Access to session variable in model
Hello again, sorry but I have no Idea how to solve it. I try to explain the problem. I am using attachment_fu for picture upload and output. I wanna change the attachment-fu to save the pics in a specific folder. Therefor my image.rb looks class Image < ActiveRecord::Base has_many :categories belongs_to :category belongs_to :products belongs_to :kwikers has_attachment :content_type => :image, :storage => :file_system, :path_prefix => 'public/assets/uploads', :max_size => 10.megabytes, :resize_to => '1024x1024>', :thumbnails => { :thumb => '150x150>'}, :processor => :MiniMagick # attachment_fu looks in this order: ImageScience, Rmagick, MiniMagick validates_as_attachment def uploaded_data=(file_data) return nil if file_data.nil? || file_data.size == 0 self.content_type = file_data.content_type extension = file_data.original_filename.slice(/\.\w+$/) self.filename = Digest::SHA1.hexdigest(Time.now.to_s) + extension File.extname(file_data.original_filename) if respond_to?(:filename) if file_data.is_a?(StringIO) file_data.rewind self.temp_data = file_data.read else self.temp_path = file_data.path end end # START: FOLDER STRUCTURE MODIFYING CODE # Changes the folder structure def full_filename(thumbnail = nil) file_system_path = (thumbnail ? thumbnail_class : self).attachment_options[:path_prefix] File.join(RAILS_ROOT, file_system_path, created_at.strftime("%Y/%m/%d"), thumbnail_name_for(thumbnail)) end end I want to replace the created_at.strftime("%Y/%m/%d") in the full_filename method with the value which is set in session[:kwikerhash]. But I don't know how. The view file calls a method image.public_filename(:thumb) for example. What can I do to let the full_filename method take the value from the session? Please help. Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Access to session variable in model
Sijo Kg wrote: > Hi Adam Meyer >> Is there a possibility to get access to session values in model files? > > You can't do that and if any means doing that means violating MVC . > What you can do is to pass the session variable from controller to model > For example in the image.rb you have a > > def do_this(session_id) > > end > >So from controller you can pass it like > > @image_model_obj.do_this(session[:kwikerhash]) > > > > > Sijo Hi Sijo you're right. But if I set a value to @kwikerhash in the controller I have also access to it in the view. This is fucked. Because its a method which I override from the attachment_fu plugin. So I need to create the same method with parameters. Thanks -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Access to session variable in model
Hi everyone I am using attachment fu for image uploading. I try to customize the path for pictures be saved. If I call session[:kwikerhash] in the image.rb where there method for path definition is I get an undefined method or variable error. If I fill a global variable @kwikerhash in the controller with the session value and try to use it in the image.rb it says that @kwikerhash is nil. Is there a possibility to get access to session values in model files? Thanks in advance. Regards Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Running App in Production Env
Marnen Laibow-Koser wrote: > Adam Meyer wrote: >> Okay, I got it, but please do not ask how. > > I'll bite. How? > >> There was a problem with the migration to production.sqlite3 but I fixed >> it! > > And the problem was...? And you fixed it by...? > >> >> Thanks dude! > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > mar...@marnen.org Because the I changed some settings for storing the db because of having it accross all deployments. I put it into shared and symlinked it. There was a mistake in it. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Running App in Production Env
Okay, I got it, but please do not ask how. There was a problem with the migration to production.sqlite3 but I fixed it! Thanks dude! -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: Running App in Production Env
Colin Law wrote: > > What is the name of your application controller? > Are you sure it is running with the same version of rails as in > development? > If so how do you know? > > Colin Hey Colin sorry but I don't understand your questions? I already deployed the app a couple of times to my server in dev mode. Now I switched to prod and I run into trouble. I deleted the capistrano folder structure on my server and made a cold deploy, now I get the following error while the cap deploy: executing `deploy:migrate' * executing "ls -xt /srv/www/kwikit/releases" servers: ["kwikit.de"] [kwikit.de] executing command command finished * executing "cd /srv/www/kwikit/releases/20090923195330; rake RAILS_ENV=production db:migrate" servers: ["kwikit.de"] [kwikit.de] executing command *** [err :: kwikit.de] rake aborted! *** [err :: kwikit.de] *** [err :: kwikit.de] no such file to load -- application *** [err :: kwikit.de] *** [err :: kwikit.de] *** [err :: kwikit.de] (See full trace by running task with --trace) *** [err :: kwikit.de] ** [out :: kwikit.de] (in /srv/www/kwikit/releases/20090923195330) command finished failed: "sh -c \"cd /srv/www/kwikit/releases/20090923195330; rake RAILS_ENV=production db:migrate\"" on kwikit.de I have no idea what to do... I have more than one controller, the server is running in same rails version as my notebook. It works on deploying with dev anyway. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Running App in Production Env
Hi everyone, yesterday I switched the environment on my production server from dev to prod via changing the vhost file for the Apache. I changed RailsEnv development to RailsEnv production and deployed the application via capistrano. But now I get a passenger error see at http://test.kwikit.de What ist the problem? Do I need to do a cold deploy with capistrano or what ist the solution? Please help Cheers Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: German letter ä, ö, ü in rfpdf
Salil Gaikwad wrote: > Hi all, > anyone found any solution for German letter ä, ö, ü in rf pdf > i'm facing same problem and i must have tto use PDF::Writer on linux. > > Regards, > > Salil Hi Salil, I made use of the prawn plugin mentioned above. It is very easy and powerful. Cheers -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] German letter ä, ö, ü in rfpdf
Hi, I need PDF creation in Rails and decided for RFPDF. Everything works quite nice the only problem is that I can't display ä,ö,ü in the pdf documents. I found a tutorial that says that I have to create a font config file with MakeFont. I did it, but now I don't now where to put al this files. Does anyone has experience with creating PDFs in Rails with ä,ü,ö letters? Thx Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Cookies are not saved
Hi, I'm developing my first RoR application and working first time with cookies on RoR. I create a product object, save it and set the id into the cookie def create @image = Image.new(params[:image]) respond_to do |format| if @image.save @product = Product.new @product.image_id = @image.id @product.order_id = @order.id @product.save cookies[:product_id] = @product.id.to_s flash[:notice] = 'Image was successfully created.' format.html {redirect_to('/karte/waehlen')} format.xml { render :xml => @image, :status => :created, :location => @image } else format.html { render :action => "new" } format.xml { render :xml => @image.errors, :status => :unprocessable_entity } end end end Then I redirect to the "karte" controller and "waehlen" action The karte controller looks like this class KarteController < ApplicationController def waehlen @product = Product.find(cookies[:product_id]) @image = Image.find(@product.image_id) end end I try to get the product_id from the cookie. The waehlen.html.erb looks like <%= image_tag(@image.filename, :size => "190x153") %> I get a NoMethodError You have a nil object when you didn't expect it! The error occurred while evaluating nil.filename Extracted source (around line #12): 9: 10: 11: 12: <%= image_tag(@image.filename, :size => "190x153") %> I checked the Cookie folder on my filesystem. There is no Cookie. Do I have activate cookies? I already browsed for the problem, but I find only information about read/write cookies and other options. Cheers Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: ERROR: could not find gem rmagick locally or in a reposi
Frederick Cheung wrote: > On 17 Nov 2008, at 07:20, Adam Meyer wrote: > >> exctracted the zip to D:\InstantRails\rMagick >> >> and when I run update >> >>> gem update --system >> Updating RubyGems >> Nothing to update >> > That command is just for updating rubygems itself. does > gem install rmagick > not work ? > > Fred Hi Fred, if I type in gem install rmagick I get uilding native extensions. This could take a while... ERROR: Error installing rmagick: ERROR: Failed to build gem native extension. D:/InstantRails/ruby/bin/ruby.exe extconf.rb install rmagick This rmagick gem is for use only on Linux, BSD, OS X, and similar systems. Use the rmagick-win32 gem to install RMagick on Windows. See http://rmagick.rubyforge.org/install-faq.html for more information. *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --srcdir=. --curdir --ruby=D:/InstantRails/ruby/bin/ruby Gem files will remain installed in D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rmagick-2.7.2 for inspection. Results logged to D:/InstantRails/ruby/lib/ruby/gems/1.8/gems/rmagick-2.7.2/ext/RMagick/gem_make.out If I type in gem install rmagick-win32 it says ERROR: could not find gem rmagick-win32 locally or in a repository I know that I need the windows version. I already downloaded it, but I don't know where to put the gem file to make ruby find it locally. I put it to D:\InstantRails\ruby\lib\ruby\gems\1.8\gems\rmagick-2.7.1-x86-mswin32.gem hmm, no clue... -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] ERROR: could not find gem rmagick locally or in a repository
Hi, I'm trying to install the RMagick 2.7.1 (ImageMagick 6.4.5-3) Win32 Installation got here http://rubyforge.org/frs/?group_id=12&a … e_id=27880 I'm following the steps but can't find the gem rmagick locally. I exctracted the zip to D:\InstantRails\rMagick and when I run update >gem update --system Updating RubyGems Nothing to update it says that there is nothing to update. I'm running a Windows XP with Ruby 1.8 What can I do? Cheers Adam -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---