Has anyone gotten a Rails application playing well with JQuery UI and Themes I would like to build a generic application which includes common basic layouts, styles, authentication and various other optional tools.
The idea is to buil开发者_如何学JAVAd this basic application using a rake and setup yml files.
Once run, I would like to be able to "skin" or theme such an application for various use cases and wondered if anyone has actually used JQuery UI with Rails and how easy it is do integrate.
If you can recommend any starting points I would most appreciate it.
Thanks in advance.
Ideally, your javascript is going to be fairly decoupled from your backend. Rails shoudn't need to 'integrate' with jQuery. Rails should be there to simply to handle the requests and response flow. jQuery UI takes already working elements and transforms them into themeable widgets. Most of your UI elements are actually just progressive enhancements on a working site. The theming that jQuery UI provides is as simple as switching folders, or setting a variable. You could have a control in rails to determine the path of the theme, but jQuery UI is built to be themeable on its own, anything rails would do to change that would be something along the lines of file_path = '../js/custom_theme'
.
Short answer: Yes. It's quite simple to integrate jQuery and Rails, because neither has to know about the other.
Yes and No I've tried for quite some time in Rails 3.1.1. There are a number of suggestions and I found that none of them worked for me and that most were overly complex. The problem seems to be getting the javascript to fire which has to do with the way default jquery is loaded.
You need to use jquery outside of the default. When I solved that problem, I found the css had problems with it (I wasn't using any images) but it didn't render properly even though i was using the same css in the jquery-us demo and no other css in a dummy application. I was never able to figure out why . The gems offered at github didn't work either.
精彩评论