glebm/rails_email_preview — pull request #37 by wzywno (2014-03-13 12:17:18+00:00)
Title: fix for wrong 'preview_id' parameter value  for 'view' button in snippet...

Hi,
This is a fix for problem described below:

I noticed that there is a mismatch between two request while editing the email snippet and then trying to view it

Requests:
1.
Started GET "/emails/user_mailer_preview-welcome"
Processing by RailsEmailPreview::EmailsController#show as HTML
Parameters: {"preview_id"=>"user_mailer_preview-welcome"}

2.
Started GET "/emails/raw/user_mailer_preview-welcome_email?email_locale=en&part_type=text%2Fhtml"
Processing by RailsEmailPreview::EmailsController#show_body as HTML
Parameters: {"email_locale"=>"en", "part_type"=>"text/html", "preview_id"=>"user_mailer_preview-welcome_email"}

In first, preview_id:
user_mailer_preview-welcome
in second, preview_id:
user_mailer_preview-welcome_email

This mismatch causes troubles of course:
ActionController::RoutingError - Not Found:
/rails_email_preview/app/controllers/rails_email_preview/emails_controller.rb:96:in `load_preview'