class CommentsController < ApplicationController hobo_model_controller def create flash_success = "Comment posted successfully." flash_invalid = "Posting Comment failed!" hobo_create :html_response => proc { flash[:notice] = flash_success redirect_to iteration_path(params[:comment][:iteration_id]) }, :invalid_html_response => proc { flash[:warning] = flash_invalid redirect_to iteration_path(params[:comment][:iteration_id]) }, :js_response => proc { flash[:notice] = flash_success @new_comment = hobo_render_tag("comment") @flash_box = hobo_render_tag("flash_box") }, :invalid_js_response => proc { flash[:warning] = flash_invalid @flash_box = hobo_render_tag("flash_box") } end end