i'm completing assignment school in need receive information html form ruby cgi script, , use fadein() jquery method display it. my script looks like: #!/usr/local/bin/ruby -w require 'cgi' cgi = cgi.new('html4') cgi.out{ cgi.html{ cgi.head{cgi.title{"this test"}+ cgi.style{"p{color = red;}"}} + cgi.body{cgi.p{"try " + cgi['ffname'] + ", did work?"}} } } this of test code, make sure server working way thought was. when try , use like: puts "<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>" the server refuses run it, guess that's not allowed. i'm still beginner ruby cgi class. how can reference jquery library these cgi methods? similar how sending html client side, send javascript code client side. javascript code contain call jquery function.
i have app list , email models many many association. want users able add many emails lists @ once, have function in controller split emails custom textfield in new list form "emails" array. i want validation error if it's blank added custom validation on field in lists model: class list < applicationrecord has_and_belongs_to_many :emails #tried adding ", validates: false" here too, didn't work #custom attr_accessor :emails validates :emails, presence: true end it works great, except when try associate existing email list (in case user entered 1 in db), validation error. oddly, can prevent validation error when associating net new emails lists "(validation: false)" seen below, not when email exists already, if add save function , append "validation: false". part of controller in question is: emails.each |email| if email.where(email: email).blank? db_email = email.new( email: email ) db_email...
Comments
Post a Comment