redirect_to(:back, :notice => "Photo was successfully created. Click
<a href='#{url_for artist_photo_path(@photo.artist, @photo)}'>here</a>
to view it")
The flash notice message is shown however, it shows: "Photo was
successfully created. Click <a href='/artists/1/photos/39'>here</a> to
view it". It displays the anchor element as a string instead of an
html element
redirect_to(:back, :notice => "Photo was successfully created. Click
<a href='#{url_for artist_photo_path(@photo.artist, @photo)}'>here</a>
to view it")
The flash notice message is shown however, it shows: "Photo was
successfully created. Click <a href='/artists/1/photos/39'>here</a> to
view it". It displays the anchor element as a string instead of an
html element
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
Arailsdemo, I dont think the sanitize helper works in the controller
level. I get the error: undefined method `sanitize
Marnen, please be more specific!
Look at where you're displaying the contents of the flash; you may
need to either not call h() or use the raw helper to indicate that the
contents of the flash are safe to display