Newsgroups: comp.lang.ruby
From: Michael Neumann <mneum...@ntecs.de>
Date: Tue, 12 Jul 2005 18:40:38 +0900
Local: Tues, Jul 12 2005 5:40 am
Subject: [ANN] Wee 0.9.0 - Nitro/Rails integration
Hi,
I'm proud to release Wee 0.9.0. Lots of refactorings, bug fixes and new WHAT is Wee? It's a framwork for very dynamic, component-oriented, To get started quickly: # Install Wee: # Write your first example # Now point your browser at http://127.0.0.1:2000/app Have Fun! Regards, Michael ======================================================================== * Wee::ComponentDispatcher This allows bookmarkable URLs like /catalog/item/171323 to be class CatalogComponent < Wee::Component ... catalog = CatalogComponent.new d.add_rule(/catalogue\/item\/(\d+)/, catalog) do |c, md| Keep in mind, that now, your anchor tags within r.anchor.info("catalogue/item/#{ new_item_no }").callback .... By default, all links will leave the current URI as is. * Wee::LoginDecoration * Wee::Pager * Wee::Examples::Counter * Wee::Examples::EditableCounter * Wee::Examples::Calculator ======================================================================== * r.label # => <label>...</label> * r.hidden_input # => <input type="hidden" ...> * r.anchor.info(info_url) * Added support for radio buttons (methods r.new_radio_group and * You can now use #value of textarea fields instead of #with. * Implemented r.form.onsubmit_update method * Method Brush::SelectListTag#selected takes optionally a block. In * Method Brush::SelectListTag#labels also might be passed a block, in * Added class Brush::CheckboxTag and corresponding methods * Method HtmlCanvas#paragraph is no longer a single tag. It can now * Added method HtmlCanvas#multiline_text, which replaces newline ======================================================================== * Added :local option, with which one can class MyComponent < Wee::Component Futhermore, added an :r_as_param option, which generates a render ======================================================================== * examples/dispatcher.rb ======================================================================== Wee can now be used from within Nitro or Rails, but it's functionality A brief example using Nitro+Wee: require 'wee' class AppController < Nitro::Controller scaffold_with_component do Nitro.run(:host => '127.0.0.1', :port => 9999, :dispatcher => Now point your browser to http://127.0.0.1:9999/app/index. An example how to use Rails+Wee follows (most stuff applies to Nitro as ## require 'wee' ## class MyComponent < Wee::Component ## class WeeController < ApplicationController register_component "my" do ## <html><body> Of course you can render as many components as you like on one page. make_component component_name, component_object For example instead of using 'register_component' in the WeeController def index If you don't need the component anymore, drop it: drop_component 'my' If you want to map 1:1 a Wee::Component to an ActionController, you can class WeeController < ApplicationController scaffold_with_component do At the moment, only pageless mode is possible, so no backtracking is NOTE: Your Wee components must be fully marshallable to work with Rails r.anchor.callback { answer true } You have to write: r.anchor.callback(:answer, true) Or more general: r.anchor.callback(Wee::LiteralMethodCallback.new(self, :answer, true)) ======================================================================== [1]: http://rubyforge.org/projects/wee You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||