public
Description: Lifo's Lab
Homepage: http://m.onkey.org
Clone URL: git://github.com/lifo/fabs.git
lifo (author)
Sun Mar 30 11:47:01 -0700 2008
commit  fae67add1d34ef576b68f10c3ed49d7fe8c52be9
tree    60ff04eb946ab258f057e0cbd8317bd73b7273ee
parent  bf9c6663b9ed869f1f2a8fd6842c6f219db9e030
fabs / rails-mini / rjs.rb
100644 33 lines (27 sloc) 0.625 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# thin -p 3000 -r rjs.rb start
 
require 'tinyrails'
 
routes do
  root :controller => 'home'
  connect ':controller/:action'
end
 
controller "home" do
  def index
    render :inline => <<-TEMP
<html>
<head>
<%= javascript_include_tag :defaults %>
</head>
<body>
<%= "foo is #{params[:foo]} and bar is #{params[:bar]}" %>
<%= link_to_remote("Ajaxy", { :update => "whatever", :url => { :action => "my" } }) %>
</body>
</html>
TEMP
  end
  
  def my
    render :update do |page|
      page.redirect_to :action => 'index', :foo => 1, :bar => 2
    end
  end
end
 
start