开发者

Getting Rails out of the way?

开发者 https://www.devze.com 2022-12-19 12:28 出处:网络
I have a legacy app that was built entirely in jQuery and HTML.Does a lot AJAX calls and so forth. I needed an authentication framework for it, so I wrapped it in a Rails app.

I have a legacy app that was built entirely in jQuery and HTML. Does a lot AJAX calls and so forth.

I needed an authentication framework for it, so I wrapped it in a Rails app.

Rails -> does the authentication jQuery/HTML -> all the rest

The problem is that the jQuery stuff doesn't seem to work anymore. All my regular AJAX calls get nothing back from the server.

Does Rails interfere with normal AJAX calls? Is there a way to get it out of the way? i.e. I want to do the authentication, then hand off to the jQuery app and not have any interference.

I don't have the time or patience to turn it into a true Rails app.

(Or is there a better way to do this? I looked at some jQuery/Javascript authentication, but couldn't get my he开发者_如何转开发ad around it)


Sounds like you don't really want to use Rails. Rails is meant to be a full application framework, and as such will most certainly 'get in your way'.

I'd suggest a simpler framework, something like Sinatra: http://www.sinatrarb.com/


The issue is that Rails automatically includes the prototype javascript library which gets in the way of jQuery. A quick solution may be to use jRails which should replace those protoype calls with jquery ones.

0

精彩评论

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