Skip to content

Instantly share code, notes, and snippets.

@errakeshpd
Created July 7, 2015 04:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save errakeshpd/0f2bd2eb5064b5255fa7 to your computer and use it in GitHub Desktop.
Save errakeshpd/0f2bd2eb5064b5255fa7 to your computer and use it in GitHub Desktop.
Is there any way to create text fields based on the javascript variable
in a model popup receiving a variable as question type id as '$('#subquestion').val()' based on this value the model popup content have to create
<%@lg = Language.all %>
<% @qs_type = Question.find( javascript value ).question_type %>
<% @lg.each do |n| %>
if ( @qs_type == 11)
matchingtype question two textbox
<%= text_area %>
<%= text_area %>
elsif @qs_type == 3
mutiple choice one textbox.
<%= text_area %>
<% end %>
is there any way to do this ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment