-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b8de2e6
Showing
64 changed files
with
334 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
yasnippets snippet definitions for use with Ruby on Rails | ||
|
||
for information on yasnippets see http://code.google.com/p/yasnippet/ | ||
for information on Ruby on Rails see http://www.rubyonrails.org/ | ||
|
||
contents: | ||
|
||
- setup.el: contains some configuration options for using yasnippets | ||
in a Ruby on Rails project, specifically in .rhtml files | ||
alongside Rhtml-Mode and MuMaMo-Mode | ||
|
||
- rails-snippets: the actual directory of snippets | ||
|
||
- util: The file I used to convert these snippets from | ||
rinari-abbrevs.el. All credit for their content goes to | ||
the creaters of rinari-abbrevs.el... ``Thanks to | ||
TextMate, Pete Kazmier, and Galinsky Dmitry'' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
yasnippets snippet definitions for use with Ruby on Rails | ||
|
||
for information on yasnippets see http://code.google.com/p/yasnippet/ | ||
|
||
contents: | ||
|
||
- setup.el: contains some configuration options for using yasnippets | ||
in a Ruby on Rails project, specifically in .rhtml files | ||
alongside Rhtml-Mode and MuMaMo-Mode | ||
|
||
- rails-snippets: the actual directory of snippets | ||
|
||
- util: The file I used to convert these snippets from | ||
rinari-abbrevs.el. All credit for their content goes to | ||
the creaters of rinari-abbrevs.el... ``Thanks to | ||
TextMate, Pete Kazmier, and Galinsky Dmitry'' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rhtml-mode |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%$. -%> | ||
# -- | ||
<%$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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%=$. %> | ||
# -- | ||
<%=$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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#name : <%= form_tag :action => " ... " %> $. <%= end_form_tag %> | ||
# -- | ||
<%= form_tag :action => "$0update}" %> | ||
$0 | ||
<%= end_form_tag %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%=h ... %> | ||
# -- | ||
<%=h $0@item} %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#name : <% if ... -%> $. <% end -%> | ||
# -- | ||
<% if $0cond} -%> | ||
$0 | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#name : <% if ... -%> $. <% else -%> <% end -%> | ||
# -- | ||
<% if $0cond} -%> | ||
$0 | ||
<% else -%> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%= link_to " ... ", :action => " ... " %> | ||
# -- | ||
<%= link_to "$0title}", :action => "$0index}" %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%= link_to " ... ", :action => " ... ", :id => ... %> | ||
# -- | ||
<%= link_to "$0title}", :action => "$0edit}", :id => $0@item} %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%= link_to " ... ", :controller => " ... " %> | ||
# -- | ||
<%= link_to "$0title}", :controller => "$0items}" %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%= link_to " ... ", :controller => " ... ", :action => " ... " %> | ||
# -- | ||
<%= link_to "$0title}", :controller => "$0items}", :action => "$0index}" %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : <%= link_to " ... ", :controller => " ... ", :action => " ... ", :id => ... %> | ||
# -- | ||
<%= link_to "$0title}", :controller => "$0items}", :action => "$0edit}", :id => $0@item} %> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#name : <% unless ... -%> $. <% end -%> | ||
# -- | ||
<% unless $0cond} -%> | ||
$0 | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : assert_equal ... , ... | ||
# -- | ||
assert_equal ${expected}, ${actual} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : assert_kind_of ... , ... | ||
# -- | ||
assert_kind_of ${class}, ${object} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : assert_not_nil ... | ||
# -- | ||
assert_not_nil ${object} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : assert_raises ... { $. } | ||
# -- | ||
assert_raises ${Exception} { $. } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : assert_response : ... | ||
# -- | ||
assert_response :${success} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : assert_redirected_to :controller => " ... " | ||
# -- | ||
assert_redirected_to :controller => "${controller}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : belongs_to : ... | ||
# -- | ||
belongs_to :${class} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : flash[: ... ] = " ... " | ||
# -- | ||
flash[:${notice}] = "${Text here...}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : has_many : ... | ||
# -- | ||
has_many :${class} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : has_one : ... | ||
# -- | ||
has_one :${class} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : logger.info " ... " | ||
# -- | ||
logger.info "${Text here...}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : params[: ... ] | ||
# -- | ||
params[:${id}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :action => " ... " | ||
# -- | ||
render :action => "${action}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :action => " ... ", :layout => " ... " | ||
# -- | ||
render :action => "${action}", :layout => "${layoutname}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render_component :action => " ... " | ||
# -- | ||
render_component :action => "${index}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render_component :controller => " ... " | ||
# -- | ||
render_component :controller => "${items}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render_component :controller => " ... ", :action => " ... " | ||
# -- | ||
render_component :controller => "${items}", :action => "${index}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : redirect_to :action => " ... " | ||
# -- | ||
redirect_to :action => "${index}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : redirect_to :action => " ... ", :id => ... | ||
# -- | ||
redirect_to :action => "${show}", :id => ${@item} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : redirect_to :controller => " ... " | ||
# -- | ||
redirect_to :controller => "${items}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : redirect_to :controller => " ... ", :action => " ... " | ||
# -- | ||
redirect_to :controller => "${items}", :action => "${list}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : redirect_to :controller => " ... ", :action => " ... ", :id => ... | ||
# -- | ||
redirect_to :controller => "${items}", :action => "${show}", :id => ${@item} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :file => " ... " | ||
# -- | ||
render :file => "${filepath}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :file => " ... ", :use_full_path => ... | ||
# -- | ||
render :file => "${filepath}", :use_full_path => ${false} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :inline => " ... " | ||
# -- | ||
render :inline => "${<%= 'hello' %>}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :inline => " ... ", :locals => { ... => " ... " } | ||
# -- | ||
render :inline => "${<%= 'hello' %>}", :locals => { ${name} => "${value}" } |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :inline => " ... ", :type => : ... ) | ||
# -- | ||
render :inline => "${<%= 'hello' %>}", :type => :${rxml}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :layout => " ... " | ||
# -- | ||
render :layout => "${layoutname}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :nothing => ... | ||
# -- | ||
render :nothing => ${true} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :nothing => ... , :status => ... | ||
# -- | ||
render :nothing => ${true}, :status => ${401} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :partial => " ... " | ||
# -- | ||
render :partial => "${item}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :partial => " ... ", :collection => ... | ||
# -- | ||
render :partial => "${item}", :collection => ${items} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :partial => " ... ", :locals => { : ... => " ... "} | ||
# -- | ||
render :partial => "${item}", :locals => { :${name} => "${value}"} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :partial => " ... ", :object => ... | ||
# -- | ||
render :partial => "${item}", :object => ${object} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :partial => " ... ", :status => ... | ||
# -- | ||
render :partial => "${item}", :status => ${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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :text => " ... " | ||
# -- | ||
render :text => "${Text here...}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :text => " ... ", :layout => " ... " | ||
# -- | ||
render :text => "${Text here...}", :layout => "${layoutname}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :text => " ... ", :layout => ... | ||
# -- | ||
render :text => "${Text here...}", :layout => ${true} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : render :text => " ... ", :status => ... | ||
# -- | ||
render :text => "${Text here...}", :status => ${401} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : session[: ... ] | ||
# -- | ||
session[:${user}] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_associated : ... | ||
# -- | ||
validates_associated :${attr} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_confirmation_of : ... | ||
# -- | ||
validates_confirmation_of :${attr} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_exclusion_of : ... | ||
# -- | ||
validates_exclusion_of :${attr} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_format_of : ... , :with => / ... / | ||
# -- | ||
validates_format_of :${attr}, :with => /${regex}/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_numericality_of : ... | ||
# -- | ||
validates_numericality_of :${attr} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_presence_of : ... | ||
# -- | ||
validates_presence_of :${attr} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#name : validates_uniqueness_of : ... | ||
# -- | ||
validates_uniqueness_of :${attr} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
;;; setup.el --- setup yasnippets for use with rails | ||
(require 'yasnippet) | ||
(yas/initialize) | ||
(yas/load-directory | ||
(concat (file-name-directory (or load-file-name buffer-file-name)) | ||
"rails-snippets/")) | ||
|
||
;;; If you are using MuMaMo or nxml, you will need to tweak the mumamo | ||
;;; keymap to let tab work for yasnippets | ||
(setq mumamo-map | ||
(let ((map (make-sparse-keymap))) | ||
(define-key map [(control meta prior)] 'mumamo-backward-chunk) | ||
(define-key map [(control meta next)] 'mumamo-forward-chunk) | ||
(define-key map [tab] 'yas/expand) | ||
map)) | ||
(mumamo-add-multi-keymap 'mumamo-multi-major-mode mumamo-map) | ||
|
||
;;; setup.el ends here |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
(require 'yasnippet) | ||
|
||
(mapcar | ||
(lambda (abbrev) | ||
(let* ((filename (car abbrev)) | ||
(snip (cdr abbrev)) | ||
(desc (replace-regexp-in-string | ||
"\n" " " | ||
(replace-regexp-in-string "\\$\\${\\([^}]*\\)}" | ||
" ... " | ||
snip))) | ||
(body (replace-regexp-in-string | ||
"\\$\." "$0" | ||
(replace-regexp-in-string "\\$\\${\\([^}]*\\)}" | ||
"${\\1}" | ||
snip)))) | ||
(with-temp-file (concat "../rails-snippets/rhtml-mode/" filename) | ||
(insert (format "#name : %s\n# --\n" desc)) | ||
(insert (format "%s\n" body))))) | ||
rhtml-mode-snips) | ||
|
||
(setq | ||
rhtml-mode-snips | ||
'( | ||
;; view | ||
("%ft" . "<%= form_tag :action => \"$${update}\" %>\n$.\n<%= end_form_tag %>") | ||
("%lia" . "<%= link_to \"$${title}\", :action => \"$${index}\" %>") | ||
("%liai" . "<%= link_to \"$${title}\", :action => \"$${edit}\", :id => $${@item} %>") | ||
("%lic" . "<%= link_to \"$${title}\", :controller => \"$${items}\" %>") | ||
("%lica" . "<%= link_to \"$${title}\", :controller => \"$${items}\", :action => \"$${index}\" %>") | ||
("%licai" . "<%= link_to \"$${title}\", :controller => \"$${items}\", :action => \"$${edit}\", :id => $${@item} %>") | ||
("%h" . "<%=h $${@item} %>") | ||
("%if" . "<% if $${cond} -%>\n$.\n<% end -%>") | ||
("%ifel" . "<% if $${cond} -%>\n$.\n<% else -%>\n<% end -%>") | ||
("%unless" . "<% unless $${cond} -%>\n$.\n<% end -%>") | ||
("%" . "<%$. -%>") | ||
("%%" . "<%=$. %>"))) | ||
|
||
(setq | ||
ruby-mode-snips | ||
'( | ||
;; model | ||
("bt" . "belongs_to :$${class}") | ||
("hm" . "has_many :$${class}") | ||
("ho" . "has_one :$${class}") | ||
;; controller renders | ||
("ra" . "render :action => \"$${action}\"") | ||
("ral" . "render :action => \"$${action}\", :layout => \"$${layoutname}\"") | ||
("rf" . "render :file => \"$${filepath}\"") | ||
("rfu" . "render :file => \"$${filepath}\", :use_full_path => $${false}") | ||
("ri" . "render :inline => \"$${<%= 'hello' %>}\"") | ||
("ril" . "render :inline => \"$${<%= 'hello' %>}\", :locals => { $${name} => \"$${value}\" }") | ||
("rit" . "render :inline => \"$${<%= 'hello' %>}\", :type => :$${rxml})") | ||
("rl" . "render :layout => \"$${layoutname}\"") | ||
("rn" . "render :nothing => $${true}") | ||
("rns" . "render :nothing => $${true}, :status => $${401}") | ||
("rp" . "render :partial => \"$${item}\"") | ||
("rpc" . "render :partial => \"$${item}\", :collection => $${items}") | ||
("rpl" . "render :partial => \"$${item}\", :locals => { :$${name} => \"$${value}\"}") | ||
("rpo" . "render :partial => \"$${item}\", :object => $${object}") | ||
("rps" . "render :partial => \"$${item}\", :status => $${500}") | ||
("rt" . "render :text => \"$${Text here...}\"") | ||
("rtl" . "render :text => \"$${Text here...}\", :layout => \"$${layoutname}\"") | ||
("rtlt" . "render :text => \"$${Text here...}\", :layout => $${true}") | ||
("rts" . "render :text => \"$${Text here...}\", :status => $${401}") | ||
("rcea" . "render_component :action => \"$${index}\"") | ||
("rcec" . "render_component :controller => \"$${items}\"") | ||
("rceca" . "render_component :controller => \"$${items}\", :action => \"$${index}\"") | ||
;; redirects | ||
("rea" . "redirect_to :action => \"$${index}\"") | ||
("reai" . "redirect_to :action => \"$${show}\", :id => $${@item}") | ||
("rec" . "redirect_to :controller => \"$${items}\"") | ||
("reca" . "redirect_to :controller => \"$${items}\", :action => \"$${list}\"") | ||
("recai" . "redirect_to :controller => \"$${items}\", :action => \"$${show}\", :id => $${@item}") | ||
;; assertions | ||
("ae" . "assert_equal $${expected}, $${actual}") | ||
("ann" . "assert_not_nil $${object}") | ||
("ako" . "assert_kind_of $${class}, $${object}") | ||
("ars" . "assert_response :$${success}") | ||
("ar" . "assert_raises $${Exception} { $. }") | ||
("art" . "assert_redirected_to :controller => \"$${controller}\"") | ||
;; validations | ||
("va" . "validates_associated :$${attr}") | ||
("vc" . "validates_confirmation_of :$${attr}") | ||
("ve" . "validates_exclusion_of :$${attr}") | ||
("vp" . "validates_presence_of :$${attr}") | ||
("vu" . "validates_uniqueness_of :$${attr}") | ||
("vn" . "validates_numericality_of :$${attr}") | ||
("vf" . "validates_format_of :$${attr}, :with => /$${regex}/") | ||
;; misc | ||
("flsh" . "flash[:$${notice}] = \"$${Text here...}\"") | ||
("logi" . "logger.info \"$${Text here...}\"") | ||
("par" . "params[:$${id}]") | ||
("ses" . "session[:$${user}]"))) | ||
|
||
|