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
<div class="row bs-wizard"> | |
<div class="col-lg-3"> | |
<ol class="bs-wizard-sidebar"> | |
<li class="bs-wizard-todo bs-wizard-active"><a href="javascript:void(0)">Step1</a></li> | |
<li class="bs-wizard-todo"><a href="javascript:void(0)">Step2</a></li> | |
<li class="bs-wizard-todo"><a href="javascript:void(0)">Step3</a></li> | |
</ol> | |
</div> | |
<div class="col-lg-9"> |
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
find_source = lambda do |clazz, include_super=false| | |
files = clazz.methods(include_super).inject([]) {|c, m| c << clazz.method(m).source_location.first if clazz.method(m) and clazz.method(m).source_location; c } | |
files.uniq | |
end | |
puts find_source.call(Rails) | |
puts self.method(:get).source_location |
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
# how to add a migration to an extension | |
1. Under app folder: | |
> rails g migration add_a_field_to_a_table ... | |
2. Copy this migration from app db/migrate folder to extension db/migrate folder and rename the file: | |
> mv db/migrate/1222_add...rb <extension's db/migrate> | |
> # then rename the migration file to #_add... | |
3. still on app folder, run the following command to copy the migrate from extension to app: | |
> rake refinery_<extension name>:install:migrations |
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
# render empty page from controller | |
render :nothing => true, :status => 200, :content_type => 'text/html' |
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
package com.fml.java.struts2.interceptor; | |
import java.io.CharArrayWriter; | |
import java.io.PrintWriter; | |
import java.util.*; | |
import javax.servlet.http.HttpServletResponse; | |
import javax.servlet.http.HttpServletResponseWrapper; | |
import org.apache.commons.lang.StringUtils; |
NewerOlder