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
var uploader = new qq.FileUploader({ | |
onComplete: function(id, filename, responseJSON) { | |
if (responseJSON.success) { | |
var item = uploader._getItemByFileId(id); | |
var myElement = uploader._getElement(item, 'myCustomClass'); | |
myElement.style.display = 'inline-block'; | |
} | |
}, | |
fileTemplate: | |
'<li>' + |
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
<%= form_for(@chapter) do |f| %> | |
<% if @chapter.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@chapter.errors.count, "error") %> prohibited this chapter from being saved:</h2> | |
<ul> | |
<% @chapter.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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
class ChaptersController < ApplicationController | |
respond_to :html, :xml, :json | |
# GET /books/1/chapters/new | |
def new | |
@book = Book.find(params[:book_id]) | |
@chapter = @book.chapters.new | |
respond_with(@chapter) | |
end |