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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:02:28+00:00 2026-05-25T16:02:28+00:00

I’m trying to make markitup! work with rails 3.1, the magic happens inside my

  • 0

I’m trying to make markitup! work with rails 3.1, the magic happens inside my posts controller,
so I threw the markup javascript in assets/javascript and added in my posts.js (so only textarea in posts view would get appended)

$(document).ready(function() {
  $(".markItUp").markItUp(mySettings);
});

in my assets/stylesheets/posts.css

.markItUpHeader ul .markItUpDropMenu {
background:transparent url(images/menu.png) no-repeat 115% 50%;
margin-right:5px;
}

further more I change

images/menu.png to <% asset_path 'menu.png' %>

so it would get the good asset_path images path

in the jquery.markitup.js file I changed the root path to

options = {
root: '<%= asset_path 'jquery.markitup.js' %>'

so it won’t use the markitup made function to check for root set and use my root instead

jquery.markitup.js.erb

// compute markItUp! path
if(!options.root) {
etc .... (does the markitup path computation for the .js file

so it would get the right path to the main js file
my _form.html.erb file is

<%= f.text_area :content, :class => 'markItUp' %>

this does work as it does show the text area with the width:700px that is set in posts.css.erb

.markItUp {
 width:700px;
 etc ....

but still nothing else shows or works, I don’t have the small toolbar above my text area for the text editing (B, I etc…)

thank you in advance, HeTzi & Guy.

markItUp documentation: http://markitup.jaysalvat.com/documentation/

  • 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-25T16:02:29+00:00Added an answer on May 25, 2026 at 4:02 pm

    I’m not quite sure, what’s not working for you… but I have managed to get it working in rails 3.1. From what you’ve posted above, I have a couple suspicions.

    First off, in Rails 3.1, from what I can tell in the day or so it’s been since I upgraded, it (RoR 3.1) intelligently routes files in: app/assets to the appropriate images, stylesheets, and javascripts folder.

    So this:

    background:transparent url(images/menu.png) no-repeat 115% 50%;
    

    Should be:

    background:transparent url(/assets/menu.png) no-repeat 115% 50%;
    

    My root option has been left to the default:

    ''
    

    Also, you haven’t included the set.js(?) file for defining the markup… If you click the link below, scroll down, and click the ‘JSON’ tab you’ll see what I mean.

    http://markitup.jaysalvat.com/examples/html/
    

    From my own project (using coffee script, and settings from a bbcode example on the MarkItUp page):

    myBbcodeSettings = {
    previewParserPath:  '', // path to your BBCode parser
    markupSet: [
        {name:'Bold', key:'B', openWith:'[b]', closeWith:'[/b]'},
    
        ...
    
        {name:'Preview', className:"preview", call:'preview' }
        ]
    }
    
    $("#parent-element textarea").markItUp(myBbcodeSettings);
    

    Finally, I was having a problem with it not being initialized because I forgot to make sure it had loaded and was actually on the page, but it doesn’t appear you should have that problem.

    Good luck!

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

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.