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

  • Home
  • SEARCH
  • 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 6726709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:57:33+00:00 2026-05-26T09:57:33+00:00

I pass parameter with url called var which is containing value ‘event’. I want

  • 0

I pass parameter with url called var which is containing value ‘event’. I want to check this variable in rjs file and load a modal dialog box. Following is my code.

page<<" if (:var== "event") {"
page<< "$j ('#create_evnt_dialog').dialog({
    title: 'New Trainer',
    modal: true,
    width: 500,
    close: function(event, ui) { $j ('#create_evnt_dialog').dialog('destroy') }

 });"
page << '}else{'
page.replace_html 'create_evnt', :partial => 'add_events'
page << "}"

I could not check variable event in rjs file.how can i do this?

This is my Ajax link ::

<%= link_to_remote 'Add new event', :url => {:controller => 'events', :action => 'new' }, :with=>"'var=' + escape('event')" %>

<%= link_to_remote 'Add new holidays', :url => {:controller => 'events', :action => 'new' }, :with=>"'var=' + escape('holy')" %>

This is my controller code ::

def new
@event = Event.new
@trainers= Trainer.all
@countries= Country.all
@venues= Venue.all

@var=params[:var]

if(@var == 'holy')
    @event.trainer_id='0'#If we save holiday as event we put 0 to trainer and venue
    @event.venue_id='0'  
end
end
  • 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-26T09:57:34+00:00Added an answer on May 26, 2026 at 9:57 am

    Just you can use

        if params[:template] == "viewer"
          render :action => "viewer_destroy.js.rjs"
        else
          render :action => "destroy.js.rjs"
        end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know how can I pass a parameter to the Rest url
I have to use an other application (console) to pass some parameter to this
When using call_user_func_array() I want to pass a parameter by reference. How would I
Need to pass get parameter without value and without = symbol to utilize external
I'm trying to pass a string parameter in MVC3. The URL that gets generated
Is it allowable to pass parameters to a web page through the URL (after
In my web application, I use strust2 url tag to pass parameters like id
How do I pass a parameter from a page's useBean in JSP to a
I have to pass some parameter from an action to another action,for example to
How can I pass the Parameter to a function. for example public void GridViewColumns(params

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.