Class | Admin::StreamFlowsController
In: | app/controllers/admin/stream_flows_controller.rb
Parent: | Admin::BaseController

Controlador para la administración de los flujos de stream.

### Methods

change_visibility create destroy edit index new show update

### Public Instance methods

change_visibility()

Cambiar la visibilidad de un flujo de stream.

Un flujo de stream puede estar visible en Irekia o en Agencia o en ambas o en ninguna.

[Source]

         # File app/controllers/admin/stream_flows_controller.rb, line 99
     99:   def change_visibility
    100:     @show_checked = false
    101:
    102:     if params[:w].to_s.match(/irekia/)
    103:       query = "UPDATE stream_flows SET show_in_irekia='f'"
    104:       @old = StreamFlow.find_by_show_in_irekia(true)
    105:       @css_class_name = "show_in_irekia"
    106:     else
    107:       query = "UPDATE stream_flows SET show_in_agencia='f'"
    108:       @old = StreamFlow.find_by_show_in_agencia(true)
    109:       @css_class_name = "show_in_agencia"
    110:     end
    111:     StreamFlow.connection.execute(query)
    112:
    113:
    114:     @stream_flow = StreamFlow.find(params[:id])
    115:     case params[:w]
    116:       when "irekia_on"
    117:         @stream_flow.update_attribute(:show_in_irekia, true)
    118:         @show_checked = true
    119:       when "agencia_on"
    120:         @stream_flow.update_attribute(:show_in_agencia, true)
    121:         @show_checked = true
    122:     end
    123:
    124:     respond_to do |format|
    125:       format.html { redirect_to(admin_stream_flows_url) }
    126:       format.js   # change_visibility.rjs
    127:     end
    128:   end

create()

Crear un flujo de stream nuevo.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 54
    54:   def create
    55:     @stream_flow = StreamFlow.new(params[:stream_flow])
    56:
    57:     respond_to do |format|
    58:       if @stream_flow.save
    59:         flash[:notice] = 'El flujo de stream ha sido creado.'
    60:         format.html { redirect_to admin_stream_flows_path() }
    61:         format.xml  { render :xml => @stream_flow, :status => :created, :location => @stream_flow }
    62:       else
    63:         format.html { render :action => "new" }
    64:         format.xml  { render :xml => @stream_flow.errors, :status => :unprocessable_entity }
    65:       end
    66:     end
    67:   end

destroy()

Borrar flujo de stream.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 86
    86:   def destroy
    87:     @stream_flow = StreamFlow.find(params[:id])
    88:     @stream_flow.destroy
    89:
    90:     respond_to do |format|
    91:       format.html { redirect_to(admin_stream_flows_url) }
    92:       format.xml  { head :ok }
    93:     end
    94:   end

edit()

Formulario para modificar un flujo de stream.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 48
    48:   def edit
    49:     @title = "Modificar flujo de stream"
    50:     @stream_flow = StreamFlow.find(params[:id])
    51:   end

index()

Lista de los flujos de stream.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 14
    14:   def index
    15:     @title = "Flujos de stream"
    16:     @stream_flows = StreamFlow.not_empty_streaming+[nil]
    17:
    18:     # @empty_stream_flow = get_empty_stream()
    19:
    20:     respond_to do |format|
    21:       format.html # index.html.erb
    22:       format.xml  { render :xml => @stream_flows }
    23:     end
    24:   end

new()

Formulario para crear un flujo de stream nuevo.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 37
    37:   def new
    38:     @title = "Nuevo flujo de stream"
    39:     @stream_flow = StreamFlow.new
    40:
    41:     respond_to do |format|
    42:       format.html # new.html.erb
    43:       format.xml  { render :xml => @stream_flow }
    44:     end
    45:   end

show()

Ver la información sobre un flujo de stream concreto.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 27
    27:   def show
    28:     @stream_flow = StreamFlow.find(params[:id])
    29:
    30:     respond_to do |format|
    31:       format.html # show.html.erb
    32:       format.xml  { render :xml => @stream_flow }
    33:     end
    34:   end

update()

Modificar los datos de un flujo de stream.

[Source]

        # File app/controllers/admin/stream_flows_controller.rb, line 70
    70:   def update
    71:     @stream_flow = StreamFlow.find(params[:id])
    72:
    73:     respond_to do |format|
    74:       if @stream_flow.update_attributes(params[:stream_flow])
    75:         flash[:notice] = 'Los datos has sido modificados.'
    76:         format.html { redirect_to admin_stream_flows_path() }
    77:         format.xml  { head :ok }
    78:       else
    79:         format.html { render :action => "edit" }
    80:         format.xml  { render :xml => @stream_flow.errors, :status => :unprocessable_entity }
    81:       end
    82:     end
    83:   end

[Validate]