The method page
will create a new page:
page "home" do
"Hello, world!"
end
Save it as any Ruby file (*.rb), then run scratch.rb and point a browser to
http://localhost:8000/home to see the result
Arguments can be added (with a given prompt):
%label= 'Method' | |
%dd | |
%select{:method=>"test",:id=>"test_case_method",:name=>"test_case[method]"} | |
%optgroup{:label=>"Non-modifying"} | |
%option{:value =>"GET",:selected=>@test_case.method=="GET"?"selected":nil} GET | |
%optgroup{:label=>"Modifying"} | |
%option{:value =>"PUT",:selected=>@test_case.method=="PUT"?"selected":nil} PUT | |
%option{:value =>"POST",:selected=>@test_case.method=="POST"?"selected":nil} POST | |
%option{:value =>"DELETE",:selected=>@test_case.method=="DELETE"?"selected":nil} DELETE | |
%label= 'Method' | |
%dd | |
%select{:method=>"test",:id=>"test_case_method",:name=>"test_case[method]"} | |
%optgroup{:label=>"Modifying"} | |
%option{:value => "GET"} GET | |
%optgroup{:label=>"Non-modifying"} | |
%option{:value => "PUT"} PUT | |
%option{:value => "POST"} POST | |
%option{:value => "DELETE"} DELETE | |
Number of Rows: <%= select_tag(:numrows, options_for_select(%w{10 20 50 100 200 500}, session[:numrows])) %> |
=== Epic Snow Leopard Upgrayyyyd Guide === | |
Son, you’re now living in the land of 64-bit systems. | |
That means that some of your 32-bit shit is now broken. | |
Not all is lost. | |
== Fixing MySQL weirdness |
# Ruby on Rails Developer, Berlin/Potsdam | |
describe "Job: Ruby on Rails Developer(m/f)" do | |
before do | |
we = Company.new( | |
:name => 'adva Business Software GmbH', | |
:website => 'http://adva-business.com', | |
:email => '[email protected]' | |
) | |
you = Developer.new | |
job = Job.new(we, you, :title => "Ruby on Rails Developer", :location => "Berlin/Potsdam") |
The method page
will create a new page:
page "home" do
"Hello, world!"
end
Save it as any Ruby file (*.rb), then run scratch.rb and point a browser to
http://localhost:8000/home to see the result
Arguments can be added (with a given prompt):
One other cause is your :dependent callbacks. | |
class Blog < AR::Base | |
has_many :posts, :dependent => :destroy | |
end | |
This will iterate through every post and call #destroy on it. Use :delete_all if you want to just issue a single delete query. HOWEVER, this won't hit your destroy callbacks on Post. | |
class Blog < AR::Base | |
has_many :posts |
Rails CMS alternatives | |
====================== | |
Active projects: | |
--------------- | |
adva-cms | |
repo: http://github.com/svenfuchs/adva_cms/ | |
site: http://adva-cms.org/ | |
Last update: 11/24/09 | |
"the cutting edge Rails CMS platform" |
=begin | |
Note that assert{ 2.0 }'s assert_xhtml (and .be_html_with) now supersede this Gist! Get them with | |
gem install nokogiri assert2 | |
require 'assert2/xhtml' | |
And see: http://groups.google.com/group/merb/browse_thread/thread/3588d3f75fa0e65c | |
----8<--------------------------- |
Error: JSON.parse | |
Source File: http://static.ak.connect.facebook.com/connect.php/en_US/js/Api/CanvasUtil/Connect/XFBML | |
Line: 31 | |
FB.JSON=function FB_JSON(){};FB.JSON.deserialize=function(b,a){if(FB.Sys.isNullOrEmpty(b))return null;if(a){if(!FB.JSON._64bitIntRegex)FB.JSON._64bitIntRegex=new RegExp('([^\\\\]\"\:)([0-9]{11,20})(,|}|])','gm');b=b.replace(FB.JSON._64bitIntRegex,'$1"$2"$3');}return FB.JSON.parse(b);};if(window.JSON&&typeof JSON.parse==='function'){FB.JSON.parse=JSON.parse;}else FB.JSON.parse=function(text,reviver){var j;function walk(a,c){var b,d,e=a[c];if(e&&typeof e==='object')for(b in e)if(Object.hasOwnProperty.call(e,b)){d=walk(e,b);if(d!==undefined){e[b]=d;}else delete e[b];}return reviver.call(a,c,e);}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;cx.lastIndex=0;if(cx.test(text))text=text.replace(cx,function(a){return '\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);});if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfn |