I have a ruby script for a photo with a link to its url:
<%= if property.images[0] then link_to image_tag (property.images[0].image.url('350x263', :jpg)), user_property_image_path(user, :id => property.images[0], :property_id => property) end -%>
How do I append #gallery to the end of the URL?
Try this (broken into multiple lines for clarity):
The key bit is
:anchor => "gallery".#url_forwill recognize this and append it to the URL as a URL fragment.See the documentation on url_for for a full list of available options.