开发者

Rails - How to create a desktop application?

Is it possible to transform a 开发者_JAVA百科rails application to a desktop application? And if yes what is the best way of doing it.

And where should I start if I just want to create an simple windows desktop application that shows a few columns from a Mysql Database and check if they have changed.


Transform in the literal sense, no, no such tech exists. However, you can make a rails app that's live on the web, or any other web application appear somewhat like a desktop application (with its own icon, and even some OS integration) by using a "Site Specific Browser"

OSX: http://fluidapp.com/

Windows (and OSX): https://mozillalabs.com/prism


I think it could be possible to use activerecord but you would need to do something different when dealing with the presentation layer. Maybe run your application using JRuby (see the gem redcar for a good example of how to implement a desktop application in Ruby/Java)

There are a few things to consider: Do I just want this to run using a specific window manager? Is it important for this to be cross platform?

My guess is that you would want to JRuby in conjunction with SWT and then reuse your data layer (models etc).

I think it could be done but you will have to pick and choose from some of Rails' sub-gems.


Rails, no, but Ruby can be used for this. I would take a look at JRuby for that. Write you app in Ruby but run it on java and access all the libraries it has. FXRuby is also an option. Rhodes is supposed to be MVC and close to Rails but I don't know how close. Its intended for mobile apps though.


This won't be direct. Desktop apps coud be done using shoes which is a really great tool.

Here is a basic example:

Shoes.app :width => 300, :height => 200 do
  button("Click me!") { alert("Good job.") }
end

They provide many apps examples here: http://the-shoebox.org/

And for basic examples: https://github.com/ashbb/shoes_tutorial_walkthrough

For more details see: http://shoesrb.com/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜