Title / Description
Code def create @presentation = Presentation.new(params[:presentation]) begin @chapters = Converter::presentation(@presentation.youbbcode) rescue Converter::ConversionException => e flash[:alert] = "Error during convertion : #{e.message}" return redirect_to presentations_path end @chapters.each_with_index do |c,i| page = Ppage.new page.title = c[:title] page.summary = c[:summary] page.number = i+1 #Start at 1 page.html = c[:content] page.presentation = @presentation if PIC_REHOST #CarrierWave Hack end unless page.save flash[:alert] = "Error during page n°#{i+1}" return redirect_to presentations_path end end @presentation.is_online = true @presentation.user = current_user if user_signed_in? if @presentation.save flash[:notice] = "Presentation sucessfully uploaded and converted" redirect_to presentation_path(@presentation) else flash[:alert] = "Error during presentation validation" redirect_to presentations_path end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code