Posted by Eric Stewart
Sun, 09 Apr 2006 23:08:00 GMT
Can Ruby be useful in the enterprise? Sure! Of course, that depends on what you’re considering it for, how you define Enterprise, and what day it is (the Ruby community is very active on many fronts, and support that was once lacking is rapidly growing in many areas).
I mostly stayed away from the whole James McGovern fracas recently, but since this was one of the blogs he sent a trackback to, I’ll add one little comment that I haven’t seen too many others express. Ruby was never too bothered about its lack of widespread public adoption in the enterprise. It is doing just fine being quite useful in all kinds of environments, meeting needs and providing an increasing number of developers another powerful way to please their customers and themselves. That being said, there are definitely inroads being made.
Consider the public positions of companies that make their living in the enterprise. For example, look at the position posted by MomentumSI. Jeff Schneider has linked to some analysis done by them recently on the applicability of Ruby in the enterprise. I know and have worked with many Momentum consultants over the years and they are very bright people who have a lot of experience in that arena. Of course, ThoughtWorks thinks pretty highly of Ruby too.
Ruby (and Rails) aren’t really striving to become the great enterprise platform. They are trying (and succeeding) to be great tools to help people get things done, be productive, and enjoy their work. I don’t think the community in general cares too much if they aren’t making great strides in the enterprise (even though I think we’ll see much higher adoption there). They are having too much fun using it to do things they are doing now. And as for wondering how Ruby will continue to grow, only time will tell.
Posted in Software Development, Ruby, Ruby On Rails | Tags enterprise, rails, ruby | 1 comment
Posted by Eric Stewart
Sat, 04 Mar 2006 20:22:00 GMT
Richard White has released the latest version of his Ajax Scaffold Generator for Rails. Since I have been heads down on a mostly non-Ajax application until recently I had missed this.
If you appreciate the value of scaffolding in helping you get going in a Rails project and you want to use ajax in your application, this is a very handy way start. It also is a nice way of just generating some code you can play with if you are new to Ajax and want to quickly be able to experiment. And it doesn’t look bad. What is generated looks nice, seems to work well, and might not be too far from production ready depending on your application.
I did perform an accidental experiment. I had previously generated scaffolding for a model/controller in my test project and and re-generated scaffolding using this new ajax generator. All worked well, but I ended up with tests that were testing the original non-ajax scaffold methods. The action methods are just about the same, but they now are designed to only be called via ajax calls. My original functional tests for the controller broke. Enter redirect_or_render.
With Courtenay’s helpful method, it’s pretty easy to get this tests passing again and have these controller actions now support ajax or non-ajax calls. For example, consider the ajax generator created scaffold method create on my sample controller for objects called Tasks:
def create
@task = Task.new(params[:task])
if @task.save
@headers['task-id'] = @task.id
@headers['Content-Type'] = 'text/html; charset=utf-8'
render :partial => 'task', :layout => false, :locals => { :hidden => true }
else
render :partial => 'form_errors', :layout => false, :status => 500
end
end
This method expects to be called via xhr request and only needs to return a snippet of code. If we apply redirect_or_render the action becomes something like:
def create
@task = Task.new(params[:task])
if @task.save
@headers['task-id'] = @task.id
@headers['Content-Type'] = 'text/html; charset=utf-8'
redirect_or_render(
{ :action => 'list' },
{ :partial => 'task', :layout => false, :locals => { :hidden => true } }
)
else
redirect_or_render(
{ :action => 'new' },
{ :partial => 'form_errors', :layout => false, :status => 500 }
)
end
end
Now the create action can be called directly as well via a normal request and still function as expected. Note that there is still a bit of work to be done in this case, since we’d really like to have the action render the new action template again so we can show validation errors on the Task. So for these cases, maybe a render_or_xhr_render method would be useful.
<!- technorati tags start ->
Technorati Tags: accessibility, ajax, rails, ruby
<!
- technorati tags end ->
Posted in Software Development, Ruby, Ruby On Rails | Tags ajax, generator, plugin, rails, scaffold | 1 comment
Posted by Eric Stewart
Wed, 01 Mar 2006 00:57:00 GMT
Dave Thomas (of Pragmatic Programmers fame) has created the annotate_models plugin.
This one solves a pain I have been feeling for quite a while now. Say you are in Textmate, RadRails, vi, or whatever your tool of choice is working on one of your ActiveRecord model classes and you just can’t remember all the field attributes from your schema. This plugin gives you a command line tool to help keep that information close to where you are going to use it most.
Thanks Dave!!!
<!- technorati tags start ->
Technorati Tags: rails, ruby
<!
- technorati tags end ->
Posted in Software Development, Ruby, Ruby On Rails | Tags rails, ruby, tools | no comments
Posted by Eric Stewart
Wed, 22 Feb 2006 20:49:00 GMT
Lately I’ve been trying to make time to finish some plugin updates and get a new one out the door.
Label Helpers
A few responses have come in on the label_helpers plugin, including a contributed patch. I need to track down one report of problems with the error inclusion that I received without many details. If you have encountered this issue please send me more information and include your version of Rails.
Acts As Exportable
I have done some work on making ActiveRecord objects easier to use in exporting data, such as producing csv export files. At this point the code works well for my needs but will need a bit of work to be more generally applicable. I hope to have something out very soon.
Plugin Usage
Not surprisingly, the label_helpers plugin has been getting much more attention than assert_accessible. Web accessibility is unfortunately still not a priority to most web developers. At this point the numbers are:
assert_accessible – 12 downloads
label_helpers – 70+ downloads
See my projects page for more details.
<!- technorati tags start ->
Technorati Tags: rails, ruby
<!
- technorati tags end ->
Posted in Ruby, Ruby On Rails | Tags exporting, helper, label, plugins, rails, ruby | 2 comments
Posted by Eric Stewart
Sat, 21 Jan 2006 19:47:00 GMT
All you web developers and users out there should go take a look at the Google Word Verification Accessiblity Petition that was started by Blind Access Journal.
In a nutshell, it’s asking Google to make their captcha scheme used in registering for services accessible. A user that doesn’t see so well hits a roadblock when they are presented with those crazy little captcha graphics.
The typical solution for most cases of this problem is to provide an audio equivalent.
<!- technorati tags start ->
Technorati Tags: accessibility|web
<!
- technorati tags end ->
Posted in Software Development, Technology, Ruby On Rails | Tags accessibility, captcha, web | no comments