[Rails] Re: attachment_fu thumbnail not created

2009-06-26 Thread John Clancy

this is a great thread and helped me get my hands around debugging this 
thing.

some more tips --

1  here's another thing to look for with respect to parent_id:  if 
you're using uuid (string) instead of id (integer) make sure your 
parent_id is also a string and not an integer, otherwise you won't get 
thumbnails

2  if you're a windows user, ruby is faster than windows so for your 
create and update actions (assuming REST) make sure you stick in a 
sleep(2) to allow windows to catch up to your rails app when you post:

def create
  sleep(2)
  ..

def update
  sleep(2)
  ..

-- 
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] Privacy issues with attachment_fu and amazon s3

2009-06-20 Thread John Clancy

I've set up attachment_fu to save photos for my rails application to
amazon s3.  All works great but now I'd like to add some privacy to
this.

So, if one of my users downloads a photo it is only viewable by that
user.

One idea is to use the uuid_primary_key function to pseudo-randomize the
pictures.

That is, the general public would have to guess the uuid_primary_key to
steal the photos.

But, this is not completely safe and private.

Does anyone have any other ideas?  Or should I view uuid_primary_key as
safe enough?
-- 
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] Hosting Email

2008-11-02 Thread John Clancy

How do folks handle email for their web startup?

I have my rails app handling all of its email chores beautifully using
sendmail and ActionMailer.  New Account Confirmation, Forgotten Password
Email, Monthly Newsletter, etc.  DNS points to our server using MX
records and we're good to go.

My issue is how do I handle my corporate email -- employee email, etc?
I would really like to use google's private label hosing capability (i'm
talking about google hosting [EMAIL PROTECTED] NOT
[EMAIL PROTECTED]) as the Mail User Agent (MUA).  However, I can't
figure out how to get employee mail to bypass our web app and go to the
Mail User Agent while still maintaining the MX record link to our web
app for the web apps business(again, preferably google's corporate email
handling).

It's as if I need two sets of MX records -- one for the web app traffic
and one for our corporate/employee email.

What have other folks done?  Am I missing something fundamental?  For
example, is there a way to have sendmail accept all email but then
bounce the employee email over to an outside MUA (again, maybe google)?
-- 
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: Interesting Topics in Email

2008-10-31 Thread John Clancy

Thanks Andrew.

I will take a look at qmail -- I hadn't even heard of it before.

Google is involved because I really like the gmail system for my 
corporate email.  They have excellent spam-fighting, and well, gmail is 
just the best in my opinion.

I've been investigating the following system:

Incoming Mail
-
Internet -->
Domain Host (1and1.com) Mx Records -->
Some kind of router on my domain (sendmail or qmail??) -->
if (mail to [EMAIL PROTECTED])
  (route mail to sendmail/ActionMail on my domain)
else
  (route mail to gmail using gmail's Mx records)
end

The key thing is that all incoming mail is routed to my domain which 
then bounces the relevant mail to gmail.

What is the best program / method to check incoming email's "to" address 
and route the email accordingly?

Is this a reasonable thing to do?
-- 
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: ActiveMerchant and Encrypted Paypal Standard Checkout

2008-10-30 Thread John Clancy

Clearly, PayPal/Ebay has a bias for Mac users.

Maybe PayPal's running a quick and dirty test on click-through rates and 
is using browser type to maintain a consistent presentation to the two 
classes of users.  In the off chance that someone buys multiple items 
through WPS they won't keep seeing different versions of the landing 
page (assuming they always use the same web browser).
-- 
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: ActiveMerchant and Encrypted Paypal Standard Checkout

2008-10-30 Thread John Clancy

I checked out peepcode and it seems like I landed on the same PayPal 
page that my users land on.  Specifically, there's this text on the left 
side of the Paypal page --
Don't have a PayPal account?
Use your credit card or bank account (where available). Continue 
<--small, easily missed link
The right side of the page has a big "Log In To Paypal" box.

Yep, plugin seems to be haphazardly translated from some other source 
(as you sugggest--probably PHP).  I cut and pasted what I needed and I'm 
not even sure how much of it I'm actually using any more.  In that 
sense, it got the job done and I was grateful for it.

You're right, SSL for ipn is overkill.  It was quicker to just SSL the 
whole checkout controller instead of making an exception for my 
ipn_update action.

My app has a lot of private data on it so for marketing purposes I often 
use https in places that don't really need it -- there's that small 
slice of observant people that perhaps take comfort in seeing https 
sprinkled around and maybe that's worth the extra server encryption 
overhead.
-- 
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: ActiveMerchant and Encrypted Paypal Standard Checkout

2008-10-30 Thread John Clancy

Like you, I spent some time trying to avoid this obfuscation for my 
users but had no luck -- obviously, Paypal has set it up that way on 
purpose to encourage Paypal usage.  Not nice of them especially since a 
lot of my users are from an older demographic less savvy about 
Paypal/Web and less able to notice the little link allowing them to use 
a credit card.  They get confused.

Seperately, from the recesses of my brain here's one more little "tip" 
if you adopt the plugin -- the plugin can override most any setting that 
you can set on the website.  So, for example, if you change your ipn 
redirect url or anything in your "profile" on the website it will have 
no effect if you've also set it in your call from the rails app.

I recently switched my site from http to https and couldn't figure out 
why PayPal kept sending my IPNs and PDTs to http even though I 
instructed https on the website.  The answer was that I had forgotten 
that I was overriding the website with my orginal call from my app.
-- 
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: ActiveMerchant and Encrypted Paypal Standard Checkout

2008-10-30 Thread John Clancy

This took me about a week of hair-pulling to finally locate and I'm 
happy to save you that pain --   :)

It seems that the nice folks at PayPal actually wrote a rails plugin to 
do this and then decided to TELL NO ONE ABOUT IT!

Somehow I found it after A LOT of looking.  The name of the magic plugin 
is "PayPalWPSToolkit" and currently sits in my Rails Plugin folder.  I 
wish I could tell you the exact url I downloaded it from but I'm sure 
you can google around and find it somewhere.

I have it up and running on my site and it works like a charm.
-- 
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] Interesting Topics in Email

2008-10-30 Thread John Clancy

I have a dream email system that I'd like to set-up.  Well, actually,
I've already set it up, but I've got a few questions to ask and there's
also some limitations that I'd like to work through.

I think that this topic might be helpful for lots of other folks 'cause
my dream system seems like it's the same system that anyone with a
public-facing web application might like to have.

My dream email system has two purposes:

Purpose 1.  General Purpose Corporate Email (all email addresses except
"[EMAIL PROTECTED]") -- employee email, responding manually to users
with support questions, etc.  For this I've set-up gmail for my domain
and I've set up an MX record at my domain registrar (1and1) directing it
to use gmail as my mailserver.

Purpose 2.  Automated Interaction with My Users (email address
"[EMAIL PROTECTED]") -- sending password reset, sending welcome email
when new account established, bulk email to all of my users who "opt in"
to bulk communication, etc.  For this I'm using ActionMailer and the
sendmail program on my server (this bypasses gmail).

It's all up and working but I've got a few questions.

Question 1.  What is the performance threshhold for a bulk email using
sendmail?  I haven't hit it yet but my largest email has gone out to 500
recipients.  What if I sent an email to 10,000 recipients?  Will it send
or will it break?  I'd rather anticipate this problem now rather than
find out about it later.

Question 2.  It seems like right now sending my Purpose 2 email is
invisible to google.  That is, 1and1 isn't telling google that I'm
bypassing them and sending some of my email with sendmail.  That's the
way I want it and I hope that's actually true.  Is it?  I don't want to
get google mad at me 'cause I'm sending bulk emails that are touching
their system when I don't intend to.

Question 3.  My Purpose 2 setup has a problem in that delivery errors
are not posted back to ActionMailer.  Rather, 1and1 uses the MX record
to divert the delivery errors to my gmail account.  An example: sendmail
sends a Purpose 2 email to "[EMAIL PROTECTED]" from
"[EMAIL PROTECTED]" and the bounceback is directed by the 1and1 MX
record to gmail.  Is this confusing to gmail since gmail didn't send the
message to begin with?  Are they going to get mad at me?  The best
solution would be to have two MX records for my domain -- a Purpose 1 MX
record directing to gmail and a Purpose 2 record directing to
ActiveRecord/sendmail.  However, 1and1 tells me that they can't have
multiple MX records for one domain.

Question 4.  Given its limitations, my solution really seems like a bad
one.  What is the right way (the Ruby Way? :)) to handle Purpose 1 and
Purpose 2 email?  Some ideas:

Idea 1.  Set up a second domain "mysitemail.com" and build a
corresponding second rails app which handles Purpose 2 email.  In that
case, how could I configure my orginal rails app "mysite.com" to send
mail through "mysitemail.com" rather than through itself?  Is this a
good idea?  Note that this is not optimal in that my users would get
email from a confusing second site.

Idea 2.  Find a domain registrar that allows multiple MX records?  Does
anyone know of anyone?

How have other folks handled all of this?
-- 
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: "www" redirection

2008-10-20 Thread John Clancy

Thanks all.  This was a great discussion.

In my opinion, editing the ".htaccess" file is the most elegant, direct 
solution.  However, given my stated phobia of editing server files, I 
looked at all of your comments and ended up with this working solution:

  class ApplicationController < ActionController::Base

before_filter :redirect_www

private

def redirect_www
  begin
if request.host.include?("www.")
  redirect_to(params.merge(:host=>request.host.sub('www.','')))
end
  rescue
  end
end

  end

Some Notes --

1  I considered applying the filter only to my home page but I 
occasionally have users who link to other pages so I added it to the 
whole application even though it is a little more overhead (the filter 
is applied to every request).  Fortunately the overhead is whittled all 
the way down to the boolean "if request.host.include?("www.")" which can 
only be true once per session (the first page load).

2  I pre-emptively wrapped the code with "begin/rescue/end" because I've 
encountered strange errors in the past where the request is nil and so 
request.host would give a NoMethod error -- but, that's rare and this 
may not be necessary here.

3  The solution does not apply to initial "https" requests because as 
noted above the browser performs the certificate check prior to my 
filter being able to substitute the "www.".  Fortunately, my home page 
is http so once the home page has applied the filter to 
http://www.xyz.com all subsequent clicks on the site will omit the 
"www."

Thanks for all your help -- this was a highly successful thread for me 
and I hope it helps others.  :)

Regards,
John Clancy
-- 
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: "www" redirection

2008-10-18 Thread John Clancy

So, I am nearly certain that Alex's original solution will work but if I 
wanted to solve this within rails and avoid mucking with server files 
(which always scares little old me :) ).

Is there a way to rewrite:
  link_to(:controller=>'site', :action=>'login)
so it always links to
  https://xyz.com/site/login
no matter if it is called from
  http://xyz.com OR http://www.xyz.com

I'm thinking a helper called:
  def link_to_without_www(options, html_options={})
[some really awesome code here]
  end
-- 
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: "www" redirection

2008-10-18 Thread John Clancy

good point.  wherever i say "redirects to" i should just say "links to".

Fernando Perez wrote:
> 
>>> http://xyz.com redirects to --> https://xyz.com/site/login GOOD!
> 
> That's not redirection, that's simple URL generation.

-- 
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: "www" redirection

2008-10-18 Thread John Clancy

typo below -- "httpx" in line 6 should be "https".

John Clancy wrote:
> one piece of good new is that my home page is http://xyz.com (ie, not 
> SSL'd).  it's when they go to http://www.xyz.com and then click Login 
> and so are directed to the secure page https://www.xyz.com/site/login 
> that there's a problem.
> 
> http://xyz.com redirects to --> httpx://xyz.com/site/login GOOD!
-- 
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: "www" redirection

2008-10-18 Thread John Clancy

one piece of good new is that my home page is http://xyz.com (ie, not 
SSL'd).  it's when they go to http://www.xyz.com and then click Login 
and so are directed to the secure page https://www.xyz.com/site/login 
that there's a problem.

http://xyz.com redirects to --> httpx://xyz.com/site/login GOOD!
but
http://www.xyz.com redirects to --> https://www.xyz.com/site/login BAD!

can i get
http://www.xyz.com redirects to --> https://xyz.com/site/login GOOD!
without a new certificate?

Fernando Perez wrote:
> For SSL redirection even the .htaccess trick won't work. The browser 
> sees https, so it will first ask for the SSL certificate which will 
> obviously fail as it is made for www.yoursite.com
> 
> The only way is to purchase an additional certificate for yoursite.com

-- 
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] "www" redirection

2008-10-18 Thread John Clancy

I'm sure this is an old topic with an obvious solution --

How can I automatically redirect users who go to "www.xyz.com" to
"xyz.com" instead?

My SSL certificate is for "xyz.com" so users get a scary error message
if they try to go to "www.xyz.com".
-- 
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] Attachment_fu, db_file and Windows

2008-10-14 Thread John Clancy

I'm having trouble serving images which I have saved as db_files with
attachment_fu.  I use this code to serve the images:

Controller --
class PhotoController < ApplicationController
  def image
@photo=Photo.find(params[:id])
send_data(DbFile.find(@photo.db_file_id).data,
  :type => @photo.content_type,
  :filename => @photo.filename,
  :disposition => 'inline')
  end
end

View --
<%=image_tag(url_for(:controller=>'photo', :action=>'image',
:id=>@photo))%>

On the web page, I just get a box with a red X in it where the image
should be.  This occurs only on my development machine (windows XP) but
not on my production machine (linux).  On my production machine all
works perfectly.

To debug, I switched :disposition=>'inline' to
:disposition=>'attachment', downloaded the file, and opened with GIMP.
GIMP reports these errors:
"Premature end of JPEG file" and
"Invalid JPEG file structure -- missing SOS marker".

Does anyone have any ideas?

I am using ImageScience as my processor.

(BTW, I have already implemented the attachment_fu_patch which fixes
various windows/attachment_fu problems described here --
http://epirsch.blogspot.com/2008/01/fixing-attachmentfu-on-windows-like.html.)
-- 
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
-~--~~~~--~~--~--~---