1 class HomeController < ApplicationController
2 before_filter :authenticate_user!, :only => [
3 :index, :show, :profile, :configure, :create_token, :delete_token, :step2, :save_step2, :step3, :save_step3,
17 respond_to do |format|
19 format.html { redirect_to({:action => :configure}, {:notice => 'user token was successfully created.'}) }
21 format.html { render action: "auth_token" }
28 respond_to do |format|
29 format.html { redirect_to :action => :configure}
37 respond_to do |format|
38 if @author.step2(params[:author][:name])
39 a = if params[:step3].to_i == 1
44 format.html { redirect_to({:action => a}, {:notice => 'your name was successfully updated.'}) }
46 format.html { render action: "step2" }
56 redirect_to :action => :index
58 @artist = Artist.new params[:artist]
59 respond_to do |format|
61 format.html { redirect_to({:action => :index}, {:notice => 'artist was successfully registered.'}) }
63 format.html { render action: "step3" }
70 @comics = Comic.find(:all,
71 :include => :author, :conditions => ['author_id = ?', @author.id],
72 :order => 'updated_at desc', :limit => 20
75 respond_to do |format|
76 format.html # index.html.erb
77 format.json { render json: @comics }
83 @original_pictures = OriginalPicture.find(:all,
84 :include => [:artist, :license, :resource_picture], :conditions => ['artist_id = ?', @author.artist.id],
85 :order => 'updated_at', :limit => 20
88 respond_to do |format|
89 format.html # index.html.erb
90 format.json { render :json => @original_pictures.to_json(
91 :include => [:resource_picture, :artist, :license]