This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= render :partial => '/shared/upload_with_feedback', :locals => { :f => f, | |
:url => assets_path, | |
:dialog_file_description => 'Photos', | |
:allowed_extensions => [:jpg, :jpeg, :gif, :png], | |
:allow_multiple_files => true, | |
:max_size => 20.megabyte | |
} %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% content_for :head do %> | |
<%= javascript_include_tag 'jquery.uploadify' %> | |
<% javascript_tag do %> | |
$(document).ready(function() { | |
$("#file_uploader").fileUpload({ | |
'uploader': '/flash/uploader.swf', | |
'script': '<%= url %>', | |
'scriptData': { 'format': 'json', 'authenticity_token': encodeURIComponent('<%= form_authenticity_token if protect_against_forgery? %>'), '<%= Rails.configuration.action_controller.session[:session_key]%>': '<%= u session.session_id %>' }, | |
'fileDataName': $('#file_uploader input:file')[0].name, // Extract correct name of upload field from form field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mime/types' | |
class AssetsController < ApplicationController | |
session :cookie_only => false, :only => :create | |
def create | |
@asset = Asset.new(params[:asset]) | |
respond_to do |wants| | |
wants.html do |
NewerOlder