New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace remote_function with unobstructive javascript #603

Closed
rvlaicu opened this Issue Dec 14, 2011 · 6 comments

Comments

Projects
None yet
7 participants
@rvlaicu
Contributor

rvlaicu commented Dec 14, 2011

In rails 3.1 and onward, its preferred to use unobstructive javascript instead of remote_function calls. The call to remote_function just generates an Ajax request so it can be replaced by an inline Ajax request. These calls occur in many places across the code base, so someone could look into changing all occurrences at once.

Some resources on the matter (thanks to jerboaa and lkysow for pointing them out):
how to do the Ajax request itself
http://www.prototypejs.org/api/ajax/request
a short discussion on switching over from remote_function to unobstructive ajax
http://stackoverflow.com/questions/3332474/how-to-make-ajax-calls-with-rails-3-using-remote-function

@ghost ghost assigned tobioboye Feb 5, 2012

@mikeing2001

This comment has been minimized.

Show comment
Hide comment
@mikeing2001

mikeing2001 Jun 27, 2012

Contributor

@tobioboye are you working on this? Otherwise, I can take over.

Contributor

mikeing2001 commented Jun 27, 2012

@tobioboye are you working on this? Otherwise, I can take over.

@tobioboye

This comment has been minimized.

Show comment
Hide comment
@tobioboye

tobioboye Jun 27, 2012

Member

@daneshd and @baadshah02 were working on some remote_function fixes. You might want to consult with them before going ahead

Member

tobioboye commented Jun 27, 2012

@daneshd and @baadshah02 were working on some remote_function fixes. You might want to consult with them before going ahead

@jeffling

This comment has been minimized.

Show comment
Hide comment
@jeffling

jeffling Jul 18, 2012

Member

link_to_function and button_to_function are also deprecated as of 3.2.4. I supposed we should be replacing those as well?

Also, http://www.cowboycoded.com/2010/07/20/replacing-link_to_remote-with-ujs-in-rails-3-prototype/ this link may come in handy.

Member

jeffling commented Jul 18, 2012

link_to_function and button_to_function are also deprecated as of 3.2.4. I supposed we should be replacing those as well?

Also, http://www.cowboycoded.com/2010/07/20/replacing-link_to_remote-with-ujs-in-rails-3-prototype/ this link may come in handy.

@daneshd

This comment has been minimized.

Show comment
Hide comment
@daneshd

daneshd Jul 19, 2012

Contributor

You guys should check out Issue #475 - it's the one I've been working on. Check out my branch too, I let Jeff know the details but I've already covered a lot of cases. @hansonwu did as well but I'm not sure if he managed to get them upstream, I know I am stalled by posting for reviews and whatnot. :/

Contributor

daneshd commented Jul 19, 2012

You guys should check out Issue #475 - it's the one I've been working on. Check out my branch too, I let Jeff know the details but I've already covered a lot of cases. @hansonwu did as well but I'm not sure if he managed to get them upstream, I know I am stalled by posting for reviews and whatnot. :/

@jerboaa

This comment has been minimized.

Show comment
Hide comment
@jerboaa

jerboaa Jul 22, 2012

Member

@ummu For the time being we should focus on 3.0.x compatibility. We need to get a release out soon :) fixing link_to_function and button_to_function will be a concern for the next migration lining up: 3.0.x => 3.1 => 3.2 => 4.0.

Member

jerboaa commented Jul 22, 2012

@ummu For the time being we should focus on 3.0.x compatibility. We need to get a release out soon :) fixing link_to_function and button_to_function will be a concern for the next migration lining up: 3.0.x => 3.1 => 3.2 => 4.0.

@jeffling

This comment has been minimized.

Show comment
Hide comment
@jeffling

jeffling Jul 22, 2012

Member

Alright we merged the 475 branches, but it's failing some tests and I'm having trouble figuring out why.

No route matches {:aid=>965445656, :action=>"expand_criteria", :controller=>"results"} app/views/results/marker/_marker_panes.html.erb:

https://github.com/ummu/Markus/tree/ujs

Member

jeffling commented Jul 22, 2012

Alright we merged the 475 branches, but it's failing some tests and I'm having trouble figuring out why.

No route matches {:aid=>965445656, :action=>"expand_criteria", :controller=>"results"} app/views/results/marker/_marker_panes.html.erb:

https://github.com/ummu/Markus/tree/ujs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment