Displaying 2 results from an estimated 2 matches for "photo_url".
2011 Oct 05
3
Rails 3 routes with same name, different param name based on constraint
Hello there fellow RoR enthusiasts,
I have been wrestling with rails 3 routes for hours trying to accomplish
the following:
I want to use the *same url helper* (photo_url) in my views but have a
different route match made depending on the format of the parameter I
pass. Seems simple enough, right??
If the parameter looks like nn.nn.nnnnnn.whatever, I want the param
passed to "photos#show" to be called :site_photo_id. If the parameter
looks like an integ...
2008 Sep 18
2
Setting up Fleximage
...t; ActiveRecord::Base
acts_as_fleximage :image_directory => ''public/images/uploaded_photos''
end
Controller (photos_controller.rb)
class PhotosController < ApplicationController
def new
end
def create
@photo = Photo.new(params[:photo])
if @photo.save
redirect_to photo_url(@photo)
else
flash[:notice] = ''Your photo did not pass validation!''
render :action => ''new''
end
end
end
View (new.html.erb)
<% form_for @photo, :html => { :multipart => true } do |f| %>
<p>
<b>Name</b><br /&...