Ruby on Rails Saturday, October 30, 2010

Try this

class YourController < ApplicationController
include ActionView::Helpers::SanitizeHelper

def your_action
redirect_to(:back, :notice => sanitize("Photo was successfully
created. Click <a href='#{url_for artist_photo_path(@photo.artist,
@photo)}'>here</a> to view it"))
end
end

If you haven't used the sanitize method before, please read this
http://api.rubyonrails.org/classes/ActionView/Helpers/SanitizeHelper.html#method-i-sanitize

before using 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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment