RPG IV Training
I'm off to Cairo for some RGP training. Although, I'm not quite convinced with the language, but it is always nice to see how things perform. Besides… it's kind of a company training policy.
I'm off to Cairo for some RGP training. Although, I'm not quite convinced with the language, but it is always nice to see how things perform. Besides… it's kind of a company training policy.
This is my impressions about Rails after rolling out an Issue Tracking system in 1 week (I might put it on tamersalama.com for a taste of what can be accomplised in 1 week).
I will be refining the lists as I continue my journey. At the end, I still like the power that Java provides and I consider Ruby on Rails to be a mind opener and another powerful tool. I intend to keep it in my belt.
Came across qooXdoo and I love it.
Hard to choose a favorite widget as they're all quite nice (Tree, Menu, Color Picker, Overlapping Window, Gallery, …).
It also seems that integrating them into apps is easy, so, I might give them a try sooner.
qooxdoo is an advanced open-source javascript based toolkit. qooxdoo continues where simple HTML is not enough anymore. This way qooxdoo can help you to get your rich web application interface done - easier than ever before.
The tables:
developer (...)
functional_system (…)
developers_function_systems (developer_id, functional_system_id)
I used “functional_system” instead of simply “system”, because it was giving me errors as it is one of Rails
href="http://wiki.rubyonrails.com/nails/show/ReservedWords" target="_blank">reserved words
Rails.
The models
class FunctionalSystem < ActiveRecord::Base
has_and_belongs_to_many :developers
end
class Developer < ActiveRecord::Base
has_and_belongs_to_many :functional_systems
end
The View (templates)
I included the checkboxes representing developers working on the same system:
...
<% Developer.find(:all).each do |developer| %>
<li><%= check_box_tag(”functional_system[developer_ids][]“, developer.id, @functional_system.developers.include?
(developer))%> <%= developer.name %></li>
<% end %>
..
The Controller
...
@functional_system = FunctionalSystem.new(params[:functional_system])
…
Rails has recognized the request parameters and magically filled out the @functional_system.developers collection.
A problem occurred when I wanted to include the join_date in the association information. That is the developers_functional_systems has an additional field of “join_date”. After trying out several scenarios - I finally came
across push_with_attributes.
Adding the following lines to the controller
@functional_system = FunctionalSystem.new(params[:functional_system])
#developers collection need to be cleared. Otherwise a “Duplicate Entry” error will be returned
@functional_system.developers.clear
params[:functional_system][:developer_ids].each do |dev_id|
@functional_system.developers.push_with_attributes(Developer.find(dev_id), {”join_date” => Date.today});
end
This performs what Rails has previously done automagically. It added a new developers_functional_systems's entry
(explicitly), with the additional association info of “join_date”.
As a more friendly approach, and to make use of Rails magic, It was better off adding the “join_date” in the view.
The naming convention is a bit tricky, after several trials, this have worked:
<ul>
<% Developer.find(:all).each do |developer| %>
<li><%= check_box_tag(”functional_system[developer_ids][]“, developer.id,
@functional_system.developers.include?(developer)) %><%= developer.name %></li>
<input type=”hidden” name=”developers[join_dates][]” value=”<%= Date.today %>”>
<% end %>
</ul>
I'm still not sure how the hash represented by name=”developers[join_dates][]” is recognized as belonging to the current
“functional_system”. Does anyone have a clue?
I'm on a new gig. Freemarker + Spring + JBoss jBPM + Hibernate + MySQL + ….
Sounds like a dangerous mix (nu-b in the first 4), but I'm up for the challenge. Wish me luck.
Any comments/suggestions? Anything on jBPM in particular? (seems fairly new, least mature, least documented among the mix).
I'll try to keep the blog up with the latest.
I'm on a new gig. Freemarker + Spring + JBoss jBPM + Hibernate + MySQL + ….
Sounds like a dangerous mix (nu-b in the first 4), but I'm up for the challenge. Wish me luck.
Any comments/suggestions? Anything on jBPM in particular? (seems fairly new, least mature, least documented among the mix).
I'll try to keep the blog up with the latest.
I added Recent Visitor Geographical Info to the list of sidebar links: