Displaying 2 results from an estimated 2 matches for "films_controller".
Did you mean:
files_controller
2006 Apr 04
3
newbie - HABTM problems writing to Join Table in SQL
...t;%= director_dropdown %>
</p>
<p><label for="film_release_date">Release date</label><br/>
<%= date_select ''film'', ''release_date'', :order => [:day, :month, :year],
:start_year => 1900 %></p>
--------films_controller----------
class FilmsController < ApplicationController
def index
list
render :action => ''list''
end
# GETs should be safe (see
http://www.w3.org/2001/tag/doc/whenToUseGet.html)
verify :method => :post, :only => [ :destroy, :create, :update ],...
2006 Jan 09
1
Saving an upload
...nd
private
def sanitize_filename(file_name)
# get only the filename, not the whole path (from IE)
just_filename = File.basename(file_name)
# replace all non-alphanumeric, underscore or periods with
underscores
just_filename.gsub(/[^\w\.\-]/,''_'')
end
end
films_controller.rb:
class Admin::FilmsController < ApplicationController
...
def create
@film = Film.new(params[:film])
@film.pictures
# Add each file to the film
params[:pictures].each_with_index {|upload,i|
ss = Picture.new
ss.uploaded_file = upload
ss.position = i
@fil...