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 8488423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:31:55+00:00 2026-06-10T21:31:55+00:00

This should be simple and I’m sure it is for you. I’m a Rails

  • 0

This should be simple and I’m sure it is for you. I’m a Rails and jQuery newbie reading the Rails API for link_to and it suggests html_options = {} but there is no example I could find. Below is the html I want to end up because I want to use a jquery plugin for a modal dialog box for a contact form (if there is an easier Rails way, I’m happy to hear):

 <a href="http://mywebsite.com/contact-us.html" name="box" class="close-reveal-modal" data-reveal-id="myModal">Get more info.</a>

Based on my reading of the api, this is my best guess but it fails:

 <%= link_to 'Get more info', contact_us_path, :class => 'close-reveal-modal', html_options = {"data-reveal-id = 'myModal'"} %>

Yanking out the html_options section works, but without the call to the plugin. What I get are errors about missing closing parens, but that doesn’t make sense because everything is closed. Am I misunderstanding html_options?, sam

  • 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-06-10T21:31:57+00:00Added an answer on June 10, 2026 at 9:31 pm

    You actually don’t even need html_options at all. Rails 3 supports a data option that accepts a hash and turns that hash into individual data-* attributes:

    <%= link_to 'Get more info', contact_us_path, :class => 'close-reveal-modal', :data => { :reveal_id => 'myModal' } %>
    

    The docs for that option are actually on the ActionView::Helpers::TagHelper#tag method.

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

Sidebar

Related Questions

This should be simple, but I am still lost. There is a very similar
This should be simple, but isn't apparently. Since..Windows 3 or so, there is a
This should be simple but is boggling me for some reason. I'm sure it's
This should be simple, not sure why I'm having issues. I've tried $this.closest('.image_id').val() but
This should be simple, but I'm getting confused. I have a parent/child tables -
This should be simple task but i am not been able to find the
This should be simple, but the answer is eluding me. If I've got a
This should seem simple enough, but can't figure it out. I was porting a
Seems like this should be simple, but powershell is winning another battle with me.
I think this should be simple but I am having some difficulty implementing it.

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.