Sha256: cb60bcc4795b72042a39b2c95c3d9941e0fa0958e5f2737e9010ce407d6f4568

Contents?: true

Size: 793 Bytes

Versions: 29

Compression:

Stored size: 793 Bytes

Contents

class UsersController < ApplicationController
  respond_to :xlsx, :html
  layout Proc.new { |c| return (c.request.format.symbol == :xlsx ? false : :default )}

  # GET /users
  # GET /users.json
  def index
    @users = User.all

    respond_to do |format|
      format.html # index.html.erb
      format.xlsx
    end
  end

  def show
    @user = User.find(params[:id])
    respond_with(@user) do |format|
      format.xlsx { render "respond_with.xlsx.axlsx" }
    end
  end

  def send_instructions
    @user = User.find(params[:user_id])
    @user.send_instructions
    render plain: "Email sent"
  end

  def export
    @user = User.find(params[:id])
    respond_to do |format|
      format.xlsx do
        render xlsx: "export", filename: "export_#{@user.id}"
      end
    end
  end
end

Version data entries

29 entries across 8 versions & 3 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.0/app/controllers/users_controller.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_6.0/app/controllers/users_controller.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.2/app/controllers/users_controller.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.1/app/controllers/users_controller.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.1/app/controllers/users_controller.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_6.0/app/controllers/users_controller.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.2/app/controllers/users_controller.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.0/app/controllers/users_controller.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.1/app/controllers/users_controller.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_6.0/app/controllers/users_controller.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.2/app/controllers/users_controller.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/caxlsx_rails-0.6.3/spec/dummy_5.0/app/controllers/users_controller.rb
caxlsx_rails-0.6.3 spec/dummy_5.1/app/controllers/users_controller.rb
caxlsx_rails-0.6.3 spec/dummy_5.0/app/controllers/users_controller.rb
caxlsx_rails-0.6.3 spec/dummy_5.2/app/controllers/users_controller.rb
caxlsx_rails-0.6.3 spec/dummy_6.0/app/controllers/users_controller.rb
caxlsx_rails-0.6.2 spec/dummy_5.0/app/controllers/users_controller.rb
caxlsx_rails-0.6.2 spec/dummy_6.0/app/controllers/users_controller.rb
caxlsx_rails-0.6.2 spec/dummy_5.2/app/controllers/users_controller.rb
caxlsx_rails-0.6.2 spec/dummy_5.1/app/controllers/users_controller.rb