class Panel::PersonalConference::Desktop::PluginIntrosController < ApplicationController

  def index 
    @intro = PersonalConferenceIntro.where(:user_id => current_user.id.to_s).first
    if @intro.blank?
      @intro = PersonalConferenceIntro.new
      render "new", :layout => false
    else
      render "edit", :layout => false
    end
  end

  def create
     @intro = PersonalConferenceIntro.new(params[:personal_conference_intro])
     @intro.user_id = current_user.id
      if @intro.save
        render :json => {"success" => true}.to_json
      else
        render :json => {"success" => false}.to_json
      end
  end

  def update
    @intro = PersonalConferenceIntro.find(params[:id])
    if @intro.update_attributes(params[:personal_conference_intro])
      render :json => {"success" => true}.to_json
    else
      render :json => {"success" => false}.to_json
    end
  end

end