Sha256: 935c6aa415399f56d30934d8ac76e0fcd2a41595dd53ceb3607600e11a7305ba

Contents?: true

Size: 882 Bytes

Versions: 3

Compression:

Stored size: 882 Bytes

Contents

class UsersController < ApplicationController
    
  def index
    @users = User.all
    @json  = User.all.to_gmaps4rails
  end

  def show
    @user = User.find(params[:id])
  end

  def new
    @user = User.new
  end

  def create
    @user = User.new(params[:user])
    if @user.save
      redirect_to @user, :notice => "Successfully created user."
    else
      render :action => 'new'
    end
  end

  def edit
    @user = User.find(params[:id])
  end

  def update
    @user = User.find(params[:id])
    if @user.update_attributes(params[:user])
      redirect_to @user, :notice  => "Successfully updated user."
    else
      render :action => 'edit'
    end
  end

  def destroy
    @user = User.find(params[:id])
    @user.destroy
    redirect_to users_url, :notice => "Successfully destroyed user."
  end
  
  def test_list
    @json  = User.all.to_gmaps4rails
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gmaps4rails-0.8.8 test/dummy/app/controllers/users_controller.rb
gmaps4rails-0.8.7 test/dummy/app/controllers/users_controller.rb
gmaps4rails-0.8.6 test/dummy/app/controllers/users_controller.rb