This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title><%=Setting.app_name%></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content="Fanix"> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<%= javascript_include_tag "application" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://ruby.taobao.org' | |
# Rails | |
gem 'rails', '3.2.2' | |
gem "rails-i18n" | |
gem "jquery-rails", "2.0.1" | |
gem "rails_autolink", ">= 1.0.4" | |
# Postgresql | |
gem "pg", "0.14.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# This is a Rails init template | |
# Usage | |
# | |
# $ rails new app_name -d postgresql -m https://raw.github.com/gist/3321163 --skip-bundle | |
# | |
# remove files | |
run "rm README.rdoc" | |
run "touch README.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SessionsController < ApplicationController | |
def create | |
auth = request.env["omniauth.auth"] | |
user = User.find_by_uid(auth["uid"].to_s) || User.create_with_omniauth(auth) | |
user.token = auth["credentials"]["token"] | |
if user.save | |
session[:user_id] = user.id | |
redirect_to root_url, :notice => "Signed in!" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bundle | |
tmp/ | |
log/ | |
.sass-cache/ | |
coverage/ | |
bin/ | |
solr/data/ | |
solr/pids/ | |
db/*.sqlite3 | |
public/assets/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://ruby.taobao.org' | |
# Rails | |
gem 'rails', '3.2.13' | |
gem "rails-i18n" | |
gem "jquery-rails", "2.2.1" | |
#gem "rails_autolink", ">= 1.0.4" | |
# Postgresql | |
gem "pg", "0.14.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# This is a Rails init template | |
# Usage | |
# | |
# $ rails new app_name -d postgresql -m https://raw.github.com/gist/3303948 --skip-bundle | |
# | |
# remove files | |
run "rm README.rdoc" | |
run "touch README.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def pp?(role_item_id, permission, entity_type, entity_id=nil) | |
if do?(current_user, role_item_id, permission, entity_type, entity_id) | |
return true | |
else | |
return false | |
end | |
end |