Jump to content

The ultimate community for Ruby on Rails developers.


Photo

Radio Button Properties


  • Please log in to reply
3 replies to this topic

#1 RoboZeus

RoboZeus

    Passenger

  • Members
  • 2 posts

Posted 26 November 2013 - 11:12 PM

I'm working on a Job Posting website project for school. Basically, me and my team are trying to get it so that new jobs that employers post have to be approved by the website's administrator before showing up on the index page (where the list of jobs are). When the administrator clicks on the new job request, it goes to a page where there's a bunch of details about the job, and at the bottom of the page there's two radio buttons, labeled "yes" or "no" for accepting the job request:

<p>
  <strong>Accept Job?</strong>
<p>
  <%= f.radio_button :accept, true %><%= f.label :yes %><br />
<%= f.radio_button :accept, false %><%= f.label :no %>
 
<p>
  <strong>Reason for Rejecting:</strong><br>
  <%= f.text_area :reject_description %>  
</p>

However, I only want the "Reason for Rejecting" and the text_area to show if the "no" radio button is selected. How do I do that?



#2 Bharat Soni

Bharat Soni

    Dispatcher

  • Members
  • 54 posts
  • LocationAhmedabad

Posted 27 November 2013 - 05:01 AM

you can do that with use of JavaScript or Jquery.

 

if you wants to help regarding it then i will be here.

 

:rolleyes:


Fun with Ruby on Rails


#3 RoboZeus

RoboZeus

    Passenger

  • Members
  • 2 posts

Posted 03 December 2013 - 08:57 PM

Keep in mind, I'm using the Nitrous.IO IDE. Is it possible to embed javascript or jquery code in rails code?



#4 Bharat Soni

Bharat Soni

    Dispatcher

  • Members
  • 54 posts
  • LocationAhmedabad

Posted 04 December 2013 - 05:26 AM

Yes you can...........

 

If you required the you can embed the JavaScript or Jquery  code in rails views.


Fun with Ruby on Rails





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users