Skip to content

Instantly share code, notes, and snippets.

/**
* Module dependencies.
*/
var express = require('express')
, http = require('http')
, path = require('path');
var app = express();
class VipbbsrsbbsController < ApplicationController
# GET /vipbbsrsbbs
# GET /vipbbsrsbbs.json
def index
@vipbbsrsbbs = Vipbbsrsbb.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @vipbbsrsbbs }
end
@carloncarpio
carloncarpio / controller
Created August 29, 2012 05:37
i can't make my deleted data fadeout
def destroy
@vipbbsrsbb = Vipbbsrsbb.find(params[:id])
@vipbbsrsbb.destroy
respond_to do |format|
format.html { redirect_to vipbbsrsbbs_url }
#format.json { head :no_content }
format.js {}
end
end
def attempt_login
if authorized_user = User.authenticate(params[:username], params[:hashed_password])
# unless authorized_user.eql?(false)
session[:user_id] = authorized_user.id
session[:username] = authorized_user.username
case authorized_user.account_type
when "admin"
redirect_to :action => "index"
when "it"
redirect_to :action => "it"
def attempt_login
authorized_user = User.authenticate(params[:username], params[:hashed_password])
unless authorized_user.eql?(false)
session[:user_id] = authorized_user.id
session[:username] = authorized_user.username
case authorized_user.account_type
when "admin"
redirect_to :action => "index"
when "it"
redirect_to :action => "it"
def attempt_login
authorized_user = User.authenticate(params[:username], params[:hashed_password])
if authorized_user
redirect_to(:action => 'index')
else
redirect_to(:action => 'login')
end
end