rails select with jquery multi select is not working












0















rails select field, with jquery multi select is not working in rails. When we select the multiple options and save, it is showing only single option as selected(not all the selected options are showing.)



I am having the following select field,



    <div class="form-group">
<label>In which form the funds are held? </label></br>
<%= f.select :form_of_funds__c, options_for_select(['Savings account', 'Fixed deposit','Sale of property'], @entrepreneur.form_of_funds__c), {class: "form-control", prompt: "Please select"},{ :multiple => true, :size => 5 } %>
</div>


and the following jquery logic.



  $(document).ready(function() {
$('#cp_entrepreneur_form_of_funds__c,
#cp_entrepreneur_funds_held_on__c').multiselect({
numberDisplayed: 4
});
});


below is the rails server log.



Started PATCH "/investor_create_or_update" for ::1 at 2019-01-02 12:30:27 +0530
DEBUG: Chewy strategies stack: [2] <- atomic @ /home/prashanth/.rvm/gems/ruby-2.3.1/gems/chewy-0.8.2/lib/chewy/railtie.rb:16
Processing by InvestorVisaController#investor_create_or_update as JS
Parameters: {"utf8"=>"✓", "cp_entrepreneur"=>{"access_to_at_least_aud_40_000__c"=>"", "total_net_worth__c"=>"", "source_of_the_funds__c"=>"form-control", "funds_be_legaly_transferred_to_australia__c"=>"", "form_of_funds__c"=>["", "Savings account", "Sale of property"]*, "funds_held_on__c"=>["", "Main applicant (you)", "your spouse"],* "value_of_total_assests__c"=>"", "what_is_the_reason_for_applying_for_the__c"=>"", "status_of_property__c"=>"", "do_you_have_stable_and_regular_resources__c"=>"", "provide_evidence_for_lawful_source__c"=>""}, "commit"=>"Save and Continue"}
SET Action : investor_visa_investor_create_or_update
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1836]]
CP::Entrepreneur Load (2.1ms) SELECT "booking_informations__c".* FROM "booking_informations__c" WHERE "booking_informations__c"."primary_email_id__c" = $1 LIMIT 1 [["primary_email_id__c", "test_server4564645@gmail.com"]]
Unpermitted parameters: form_of_funds__c, funds_held_on__c
(0.2ms) BEGIN
SQL (0.7ms) UPDATE "booking_informations__c" SET "access_to_at_least_aud_40_000__c" = $1, "source_of_the_funds__c" = $2, "funds_be_legaly_transferred_to_australia__c" = $3, "status_of_property__c" = $4, "provide_evidence_for_lawful_source__c" = $5 WHERE "booking_informations__c"."heroku_id" = $6 [["access_to_at_least_aud_40_000__c", ""], ["source_of_the_funds__c", "form-control"], ["funds_be_legaly_transferred_to_australia__c", ""], ["status_of_property__c", ""], ["provide_evidence_for_lawful_source__c", ""], ["heroku_id", 2]]
(14.6ms) COMMIT









share|improve this question

























  • Did you check your web console, which error are you getting ?

    – Vishal
    Jan 2 at 6:48











  • i am not geting any eror. Please check the modified question.

    – John
    Jan 2 at 7:07











  • seems like there is something wrong in your controller. Because in the logs, I can see array ["", "Savings account", "Sale of property"]

    – G.B
    Jan 2 at 7:24













  • @John i am talking about web console of browser, not rails logs

    – Vishal
    Jan 2 at 7:42
















0















rails select field, with jquery multi select is not working in rails. When we select the multiple options and save, it is showing only single option as selected(not all the selected options are showing.)



I am having the following select field,



    <div class="form-group">
<label>In which form the funds are held? </label></br>
<%= f.select :form_of_funds__c, options_for_select(['Savings account', 'Fixed deposit','Sale of property'], @entrepreneur.form_of_funds__c), {class: "form-control", prompt: "Please select"},{ :multiple => true, :size => 5 } %>
</div>


and the following jquery logic.



  $(document).ready(function() {
$('#cp_entrepreneur_form_of_funds__c,
#cp_entrepreneur_funds_held_on__c').multiselect({
numberDisplayed: 4
});
});


below is the rails server log.



Started PATCH "/investor_create_or_update" for ::1 at 2019-01-02 12:30:27 +0530
DEBUG: Chewy strategies stack: [2] <- atomic @ /home/prashanth/.rvm/gems/ruby-2.3.1/gems/chewy-0.8.2/lib/chewy/railtie.rb:16
Processing by InvestorVisaController#investor_create_or_update as JS
Parameters: {"utf8"=>"✓", "cp_entrepreneur"=>{"access_to_at_least_aud_40_000__c"=>"", "total_net_worth__c"=>"", "source_of_the_funds__c"=>"form-control", "funds_be_legaly_transferred_to_australia__c"=>"", "form_of_funds__c"=>["", "Savings account", "Sale of property"]*, "funds_held_on__c"=>["", "Main applicant (you)", "your spouse"],* "value_of_total_assests__c"=>"", "what_is_the_reason_for_applying_for_the__c"=>"", "status_of_property__c"=>"", "do_you_have_stable_and_regular_resources__c"=>"", "provide_evidence_for_lawful_source__c"=>""}, "commit"=>"Save and Continue"}
SET Action : investor_visa_investor_create_or_update
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1836]]
CP::Entrepreneur Load (2.1ms) SELECT "booking_informations__c".* FROM "booking_informations__c" WHERE "booking_informations__c"."primary_email_id__c" = $1 LIMIT 1 [["primary_email_id__c", "test_server4564645@gmail.com"]]
Unpermitted parameters: form_of_funds__c, funds_held_on__c
(0.2ms) BEGIN
SQL (0.7ms) UPDATE "booking_informations__c" SET "access_to_at_least_aud_40_000__c" = $1, "source_of_the_funds__c" = $2, "funds_be_legaly_transferred_to_australia__c" = $3, "status_of_property__c" = $4, "provide_evidence_for_lawful_source__c" = $5 WHERE "booking_informations__c"."heroku_id" = $6 [["access_to_at_least_aud_40_000__c", ""], ["source_of_the_funds__c", "form-control"], ["funds_be_legaly_transferred_to_australia__c", ""], ["status_of_property__c", ""], ["provide_evidence_for_lawful_source__c", ""], ["heroku_id", 2]]
(14.6ms) COMMIT









share|improve this question

























  • Did you check your web console, which error are you getting ?

    – Vishal
    Jan 2 at 6:48











  • i am not geting any eror. Please check the modified question.

    – John
    Jan 2 at 7:07











  • seems like there is something wrong in your controller. Because in the logs, I can see array ["", "Savings account", "Sale of property"]

    – G.B
    Jan 2 at 7:24













  • @John i am talking about web console of browser, not rails logs

    – Vishal
    Jan 2 at 7:42














0












0








0








rails select field, with jquery multi select is not working in rails. When we select the multiple options and save, it is showing only single option as selected(not all the selected options are showing.)



I am having the following select field,



    <div class="form-group">
<label>In which form the funds are held? </label></br>
<%= f.select :form_of_funds__c, options_for_select(['Savings account', 'Fixed deposit','Sale of property'], @entrepreneur.form_of_funds__c), {class: "form-control", prompt: "Please select"},{ :multiple => true, :size => 5 } %>
</div>


and the following jquery logic.



  $(document).ready(function() {
$('#cp_entrepreneur_form_of_funds__c,
#cp_entrepreneur_funds_held_on__c').multiselect({
numberDisplayed: 4
});
});


below is the rails server log.



Started PATCH "/investor_create_or_update" for ::1 at 2019-01-02 12:30:27 +0530
DEBUG: Chewy strategies stack: [2] <- atomic @ /home/prashanth/.rvm/gems/ruby-2.3.1/gems/chewy-0.8.2/lib/chewy/railtie.rb:16
Processing by InvestorVisaController#investor_create_or_update as JS
Parameters: {"utf8"=>"✓", "cp_entrepreneur"=>{"access_to_at_least_aud_40_000__c"=>"", "total_net_worth__c"=>"", "source_of_the_funds__c"=>"form-control", "funds_be_legaly_transferred_to_australia__c"=>"", "form_of_funds__c"=>["", "Savings account", "Sale of property"]*, "funds_held_on__c"=>["", "Main applicant (you)", "your spouse"],* "value_of_total_assests__c"=>"", "what_is_the_reason_for_applying_for_the__c"=>"", "status_of_property__c"=>"", "do_you_have_stable_and_regular_resources__c"=>"", "provide_evidence_for_lawful_source__c"=>""}, "commit"=>"Save and Continue"}
SET Action : investor_visa_investor_create_or_update
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1836]]
CP::Entrepreneur Load (2.1ms) SELECT "booking_informations__c".* FROM "booking_informations__c" WHERE "booking_informations__c"."primary_email_id__c" = $1 LIMIT 1 [["primary_email_id__c", "test_server4564645@gmail.com"]]
Unpermitted parameters: form_of_funds__c, funds_held_on__c
(0.2ms) BEGIN
SQL (0.7ms) UPDATE "booking_informations__c" SET "access_to_at_least_aud_40_000__c" = $1, "source_of_the_funds__c" = $2, "funds_be_legaly_transferred_to_australia__c" = $3, "status_of_property__c" = $4, "provide_evidence_for_lawful_source__c" = $5 WHERE "booking_informations__c"."heroku_id" = $6 [["access_to_at_least_aud_40_000__c", ""], ["source_of_the_funds__c", "form-control"], ["funds_be_legaly_transferred_to_australia__c", ""], ["status_of_property__c", ""], ["provide_evidence_for_lawful_source__c", ""], ["heroku_id", 2]]
(14.6ms) COMMIT









share|improve this question
















rails select field, with jquery multi select is not working in rails. When we select the multiple options and save, it is showing only single option as selected(not all the selected options are showing.)



I am having the following select field,



    <div class="form-group">
<label>In which form the funds are held? </label></br>
<%= f.select :form_of_funds__c, options_for_select(['Savings account', 'Fixed deposit','Sale of property'], @entrepreneur.form_of_funds__c), {class: "form-control", prompt: "Please select"},{ :multiple => true, :size => 5 } %>
</div>


and the following jquery logic.



  $(document).ready(function() {
$('#cp_entrepreneur_form_of_funds__c,
#cp_entrepreneur_funds_held_on__c').multiselect({
numberDisplayed: 4
});
});


below is the rails server log.



Started PATCH "/investor_create_or_update" for ::1 at 2019-01-02 12:30:27 +0530
DEBUG: Chewy strategies stack: [2] <- atomic @ /home/prashanth/.rvm/gems/ruby-2.3.1/gems/chewy-0.8.2/lib/chewy/railtie.rb:16
Processing by InvestorVisaController#investor_create_or_update as JS
Parameters: {"utf8"=>"✓", "cp_entrepreneur"=>{"access_to_at_least_aud_40_000__c"=>"", "total_net_worth__c"=>"", "source_of_the_funds__c"=>"form-control", "funds_be_legaly_transferred_to_australia__c"=>"", "form_of_funds__c"=>["", "Savings account", "Sale of property"]*, "funds_held_on__c"=>["", "Main applicant (you)", "your spouse"],* "value_of_total_assests__c"=>"", "what_is_the_reason_for_applying_for_the__c"=>"", "status_of_property__c"=>"", "do_you_have_stable_and_regular_resources__c"=>"", "provide_evidence_for_lawful_source__c"=>""}, "commit"=>"Save and Continue"}
SET Action : investor_visa_investor_create_or_update
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT 1 [["id", 1836]]
CP::Entrepreneur Load (2.1ms) SELECT "booking_informations__c".* FROM "booking_informations__c" WHERE "booking_informations__c"."primary_email_id__c" = $1 LIMIT 1 [["primary_email_id__c", "test_server4564645@gmail.com"]]
Unpermitted parameters: form_of_funds__c, funds_held_on__c
(0.2ms) BEGIN
SQL (0.7ms) UPDATE "booking_informations__c" SET "access_to_at_least_aud_40_000__c" = $1, "source_of_the_funds__c" = $2, "funds_be_legaly_transferred_to_australia__c" = $3, "status_of_property__c" = $4, "provide_evidence_for_lawful_source__c" = $5 WHERE "booking_informations__c"."heroku_id" = $6 [["access_to_at_least_aud_40_000__c", ""], ["source_of_the_funds__c", "form-control"], ["funds_be_legaly_transferred_to_australia__c", ""], ["status_of_property__c", ""], ["provide_evidence_for_lawful_source__c", ""], ["heroku_id", 2]]
(14.6ms) COMMIT






ruby-on-rails jquery-ui-multiselect






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 7:04







John

















asked Jan 2 at 6:45









JohnJohn

3152829




3152829













  • Did you check your web console, which error are you getting ?

    – Vishal
    Jan 2 at 6:48











  • i am not geting any eror. Please check the modified question.

    – John
    Jan 2 at 7:07











  • seems like there is something wrong in your controller. Because in the logs, I can see array ["", "Savings account", "Sale of property"]

    – G.B
    Jan 2 at 7:24













  • @John i am talking about web console of browser, not rails logs

    – Vishal
    Jan 2 at 7:42



















  • Did you check your web console, which error are you getting ?

    – Vishal
    Jan 2 at 6:48











  • i am not geting any eror. Please check the modified question.

    – John
    Jan 2 at 7:07











  • seems like there is something wrong in your controller. Because in the logs, I can see array ["", "Savings account", "Sale of property"]

    – G.B
    Jan 2 at 7:24













  • @John i am talking about web console of browser, not rails logs

    – Vishal
    Jan 2 at 7:42

















Did you check your web console, which error are you getting ?

– Vishal
Jan 2 at 6:48





Did you check your web console, which error are you getting ?

– Vishal
Jan 2 at 6:48













i am not geting any eror. Please check the modified question.

– John
Jan 2 at 7:07





i am not geting any eror. Please check the modified question.

– John
Jan 2 at 7:07













seems like there is something wrong in your controller. Because in the logs, I can see array ["", "Savings account", "Sale of property"]

– G.B
Jan 2 at 7:24







seems like there is something wrong in your controller. Because in the logs, I can see array ["", "Savings account", "Sale of property"]

– G.B
Jan 2 at 7:24















@John i am talking about web console of browser, not rails logs

– Vishal
Jan 2 at 7:42





@John i am talking about web console of browser, not rails logs

– Vishal
Jan 2 at 7:42












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54002300%2frails-select-with-jquery-multi-select-is-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54002300%2frails-select-with-jquery-multi-select-is-not-working%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

Npm cannot find a required file even through it is in the searched directory