Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6139655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:01:07+00:00 2026-05-23T18:01:07+00:00

I am using a the link_to method in Rails the unobstrusive jQuery way: <%=

  • 0

I am using a the link_to method in Rails the unobstrusive jQuery way:

<%= link_to "save", 
            update_elements_diagram_path(diagram, :shown_elements => ["speed", "position_break"]),
            :method => :post, :remote => true, :class => "close",
            :onclick => "stringViewsTableLoading()" %>

This works. But now I want to get the arguments “shown_elements” dynamically from the users inputs.
I know how to get them from the form to javascript, but how from javascript to Rails?

 ... shown_elements => "getShownElements()"

or something similar would be great.

Greetings

Sandro

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:01:08+00:00Added an answer on May 23, 2026 at 6:01 pm

    Not sure I see what you mean there, so I guess that you somehow have a few fields on your page, and that what you want is to get the value of those fields in the :shown_elements.

    This is not how it’s supposed to be done. Think the other way around. You are posting a form using :method => :post, which means that those will be accessible in your target controller using params[].

    def DiagramsController < ApplicationController
    
        def update_elements
            shown_elements = params[:shown_elements] # or something like this.
        end
    
    end
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm Using Rails3 and the Unobstrusive Javascript Gem jquery-rails . Remote deletion (without page
I m using Rails 3.2.1 . how to use link_to with remote=>true My Method
I would like to pass a parameter through a link_to method in Rails. I
i want to implement a digg-like vote up/down method in my rails application using
Hi I am using jQuery with rails 3 to display or not the same
There is a nice XSRF protection for link_to method in Rails 3 that generates
I am using Ruby on Rails 3 and I would like to use jQuery
I recently ran into this problem: Rails 3 link_to (:method => :delete) not working
How do I set a path and :path_only => false for Rails' link_to method?
I'm using jquery-mobile with Ruby On Rails. I want to create a button link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.