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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:21:44+00:00 2026-05-17T18:21:44+00:00

I have a rails 2.3.9 application that i’m migrating to rails 3. As almost

  • 0

I have a rails 2.3.9 application that i’m migrating to rails 3.

As almost everyone, i’m having problem with rendering strings, specially JQUERY scripts that were inline. Before, that somebody tells me that in rails 3, it changed, i cannot rewrite all my scripts now. I will do it, it will be scheduled, but for now, i want to make it works.

Going to my question:

i have a controller with the following piece of code

respond_to do |format|
 format.js { render :partial=>'update'}
 format.html { head 406 }
end

My _update.js.erb has a mix between JS and ERB:

<% if MyClass.count > 0 %>
 $('.show_object:visible').hide();
<%else%>
  if($('.show_object').css('display') == 'none'){
   $('.show_object').blink({times: 7})
  }
<%end%>

It works in rails 2.3.9, but not in Rails 3. My question are:

  • should i put around all my jquery a html_safe call?
  • there is a way in the controller to mark a whole partial as html_safe?
  • 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-17T18:21:45+00:00Added an answer on May 17, 2026 at 6:21 pm

    I did solve it doing in my controller:

    format.js { 
     render :js=> { render_to_string(:partial=>'update').html_safe!}
    } 
    

    it works but don’t looks like a good solution. Any other idea?

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

Sidebar

Related Questions

I have a rails application that about 3 years old, and I'm having a
G'day guys, currently have almost finished writing a rails application that allows a CSV
I have a rails application that I've added jquery datepicker to a date field.
I have a Rails application that accepts file uploads of CSV files. When developing
I have a Rails application that uses ActiveRecordStore for sessions. I need a PHP
I have a Rails application that lists information about local services. My objectives for
I have a rails application that allows searches using longitude and latitude. I have
I have a Rails application that works with mongodb. I want to deploy it
I have a rails application that has three different types of users and I
I have a Rails 3 application that needs to display images from another application.

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.