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 with MongoDB projects | |
# | |
# Mongoid, Devise, Bootstrap, jQuery, Redis, Cells, will_paginate, Carrierwave, simple_form, Settingslogic, Thin | |
# | |
# Usage | |
# | |
# $ rails new app_name -m https://raw.github.com/gist/2168014 | |
# |
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
############################################################# | |
#the begin time I want use bootswatch, to encjoy multi theme which base on bootstrap,so I install some gem necessary | |
#Gemfile | |
gem "twitter-bootstrap-rails", "~> 2.1.0" | |
gem "less-rails-bootswatch", "~> 0.2.5" | |
#This gem is meant to be used with bootstrap-sass. | |
#gem "bootswatch-rails", "~> 0.0.11" | |
#bootstrap_and_overrides.css.less.erb |
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
#tag.yml | |
#encoding: utf-8 | |
妈妈: | |
备孕: | |
孕前检查 | |
孕前营养 | |
孕前调理 | |
受孕时机 | |
备孕心理 | |
不孕不育 |
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
#In summary: | |
# config/initializers/load_config.rb | |
#APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml")[RAILS_ENV] | |
# application.rb | |
#if APP_CONFIG['perform_authentication'] | |
# Do stuff | |
#end |
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
<%= simple_form_for @knowledge, :html => { :class => 'form-horizontal', :class => "form-inline", :remote => true } do |f| %> | |
<div class="knowledge-head box"> | |
<span class="label label-info">head</span> | |
<%= f.input :title %> | |
<%= f.input :summary, :input_html => { :rows =>"3", :cols =>"50" } %> | |
<!--%= f.input :content %--> | |
</div> | |
<div class="knowledge-content box"> | |
<span class="label label-info">content</span> | |
<%= f.input :body, :as => :kindeditor, :input_html => { :width => 850, :height => 500 } %> |
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
gem "weibo2", "~> 0.1.0" | |
gem "tqq2", :git => "git://github.com/jhjguxin/tqq2.git" | |
gem "connect-qq", :git => "git://github.com/jhjguxin/connect-qq.git" |
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
# in db | |
update knowledges set auto_tags = tags; | |
update questions set auto_tags = tags; | |
alter table tags rename to tags_bak; | |
rake db:migrate | |
#TODO? for identity/timeline/category tags? | |
# in rails console | |
class TagBak < ActiveRecord::Base |
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
begin | |
# something which might raise an exception | |
rescue SomeExceptionClass => some_variable | |
# code that deals with some exception | |
rescue SomeOtherException => some_other_variable | |
# code that deals with some other exception | |
else | |
# code that runs only if *no* exception was raised | |
ensure | |
# ensure that this code always runs, no matter what |
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
_form.html.erb | |
<%= f.input :body, :width => 850, :height => 500 %> | |
refresh.js.erb | |
$("#edit_<%= dom_id @knowledge %>").replaceWith("<%= render 'refresh_form'%>"); | |
$("#new_knowledge").replaceWith("<%= render 'refresh_form'%>"); | |
var editor = KindEditor.create( | |
'textarea[id="knowledge_body"]', | |
{ |
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
#No such file to load -- devise/confirmations_controller | |
#resque worker devise not eager loading | |
require File.expand_path('../config/application', __FILE__) | |
require 'rake/dsl_definition' | |
require 'resque/tasks' | |
Askjane::Application.load_tasks | |
task "resque:setup" => :environment do |