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