-
Notifications
You must be signed in to change notification settings - Fork 330
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
Inline links returning HTML and not JS #521
Comments
That's right, activescaffold will return html for inline displaying, and activescaffold JS has responders which expect html and add in the right place. Have you added require active_scaffold to your js manifest? |
Hi, I do have //= require active_scaffold in my application.js, and some parts of AS are working. ActiveScaffold.replace_html('as_admin__program_management__program_modules-209-admin__program_management__program_module_appendices-content', 'the content'); When I try to interact with the links on the generated form (or the "edit" link on the main page), I get my requests returned with just the html, and no ActiveScaffold.replace() JS wrapping it. Is there something I can do to change the handler that receives the response? Have it handled by something which isn't expecting JS? This is an older project which was on Rails 2.3.5 LTS, and is now on Rails 4. The project is using prototype and prototype-ujs. Do you think that they may possibly be interfering? |
Nested links return js code like that (ActiveScaffold.replace_html) but edit links return html and ActiveScaffold listeners will add html to right place. Request success should trigger document.on('ajax:success', 'a.as_action', function(event) which uses action_link.insert(event.memo.request.transport.responseText) to insert html in page. Are you using jquery and prototype, or just prototype? I don't know if it may be a bug in prototype/active_scaffold.js but edit links always worked like that. You could try to test those links using only jquery, with no prototype. I haven't testing prototype part of ActiveScaffold in years, and I'm thinking in dropping support, because some new features were never added to prototype part, I don't have time to support it and I don't think much people use it. I know some people use prototype and ActiveScaffold with jquery and jquery_ujs, using jQuery.noConflict, but I don't know if using jquery_ujs and prototype_ujs at same time is supported. |
I have model Template, which has thumbnail attachment, is uploaded using carrierwave. Im trying to upload image in list page. following https://github.com/activescaffold/active_scaffold/wiki/Adding-custom-actions. form is loaded as 'js' request, but when submit form it goes as 'html' request and params is record => {:thumbnail}, form is not closed and row is refreshed. Controller:
_thumbnail.html.erb
logs:
After update just stands as this form, but code inside process action link gets exceuted. |
Rails 4.2.7.1
Ruby 2.3.1
AS 3.4.41.1
Hoping that someone can help with this -- I've got an inline link for editing on my page, and it is not loading the form properly. I don't know if this is a configuration error on my part, or a bug in the AS code.
config.update.link.label = 'Edit Module'
config.update.link.inline = true
What I can see happening is that the request is going in and being handled by the controller as JS
Started GET "/admin/program_management/program_modules/209/edit?program_module_base_id=210&program_module_type=english" for 127.0.0.1 at 2016-10-11 11:34:08 -0400
Processing by Admin::ProgramManagement::ProgramModulesController#edit as JS
-- but what is returned is JUST HTML, and the AJAX Responders are erroring out because they can't parse what's returned. Any ideas?
Thanks in advance!
The text was updated successfully, but these errors were encountered: