This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Linking
Rails 2 has amazing support for format driven responses. Given a photo object, by default it would have an HTML view that describes information about that photo. With Fleximage, the JPG or (GIF or PNG) view can be the image data itself.
A photo HTML view may look like this:
# app/views/photos/show.html.erb
# Accessed via http://mysite.com/photos/123
<p>
<%= image_tag formatted_photo_path(@photo, :jpg) %>
</p>
<p>
<b>Name:</b>
<%=h @photo.name %>
</p>
<p>
<b>Author:</b>
<%=h @photo.author %>
</p>
That image tag uses a Rails route as its src. In this case, that route corresponds to the .jpg format of the photo resource, which would give us a URL like:
This is the URL where the image will be.
You may also need to update your controller’s show method, passing jpg to the respond_to block:
# app/controllers/photos_controller.rb
...
def show
@photo = Photo.find(params[:id])
respond_to do |format|
format.jpg # show.jpg.flexi (http://mysite.com/photos/123.jpg)
format.html # show.html.erb
format.xml { render :xml => @photo }
end
end
...






