params

Passing two values for one parameter inside RemoteFunction

前提是你 提交于 2019-12-11 22:11:59
问题 GSP <g:select from="['AFFILIATES', 'CSE','DISPLAYADS','EMAIL','MOBILEWEB','OTHERS','ORGANIC','SEO', 'SEM']" name="mv" id = "mv" onchange="${remoteFunction( controller:'Pgtyp', action:'ajaxGetMv', params:'\'mv=\' + escape(this.value)+\'&date_hour=\'+z+\'&date_hour=\'+ b', //params:'\'mv=\'+this.value', onSuccess: 'printpgtyp(data)')}" ></g:select> Controller def pgtyp = Pgtyp.executeQuery("select p.date_hour ,p.visits, p.mv, p.browser,p.pagetype,p.platform,p.device,p.time_period from Pgtyp p

Updating profile without updating password

做~自己de王妃 提交于 2019-12-11 17:25:09
问题 I want to be able to update my user information without having to have the user set a password each time they edit any other attribute. My current validations are: validates :password, presence: true, length: { minimum: 8 } validates :password_confirm, presence: true how can I make this conditional? It would be clever to only require these validations if the password and password_confirm attribues were in the params. I could use some idea about how to achieve this. Thanks. 回答1: I think this

Android Volley JsonObjectRequest not send params

半城伤御伤魂 提交于 2019-12-11 11:33:13
问题 I'm trying to send a JsonObjectRequest to my server with some params, but seems like params doesn't arrive at the server. Before to post on SO I try all kind of suggestion found in google but no one works fine.. This is the code of my JsonObjectRequest: RequestQueue queue = MySingleVolley.getInstance(ctx). getRequestQueue(); JsonObjectRequest jsObjRequest = new JsonObjectRequest(method,url,null, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { Log

How to pass Object tag PARAM value into Flash?

最后都变了- 提交于 2019-12-11 09:22:01
问题 Hey everyone, today I'm trying to get a link to an XML file passed from the Object Embed code into my Flash movie. (Not using SWFobject). I have 1 swf file that should be able to connect to 3 different XML files. Attempt 1 Below is the HTML code (I'm trying to get theXML path): <div class="left"> <h2>300 x 353 Green Accent Color</h2> <script type="text/javascript"> AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300'

Rails form not passing radio button values to params hash

社会主义新天地 提交于 2019-12-11 04:56:37
问题 I have used radio buttons in my app countless times, and never have experienced this issue, so I am assuming I am oblivious to a very dumb mistake. The form submits all the other model's attributes just fine, but for some reason, :referral_type just does not show up in params in the server output, and it of course is not saving to the db. = form_for(@writer, :html => { :class => "user_new", :id => "user_new" }) do |f| - unless @writer.approved? .field.divider %label How did you hear about us?

Array isn't persisted to database

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:37:55
问题 I'm trying to store an array (:vehicles) in my database. This array consists of 3 possible vehicles that the user selects with checkboxes. <% @vehicles.each_with_index do |vehicle,index| %> <label> <div > <%= check_box_tag "vehicles[]", index ,class: "available" ,style: "display:none" %> <%= vehicle %> </div> </label> <%end %> The ':vehicles' attribute type is 'text' and I used this code to make it an array: serialize :vehicles, Array If I send the params it gets these values in an array.

RoR : form.select + onchange not passing the right value in params to the controller

☆樱花仙子☆ 提交于 2019-12-11 02:38:33
问题 I have a select menu in a Ruby on Rails form defined as follows: <%= f.select :Menu1, [["Option1","value1"],["Option2","value2"]], {}, {:id=>"Menu1_Id", :class => "Menu1_Class"} %> I am using an event handler to trigger controller action when an option is selected and I want to pass to it the value of the selected option <script type="text/JavaScript" src=http://code.jquery.com/jquery-latest.js"> $(function(){ $('.Menu1_Class').bind('change', function(){ alert($(this).val()); $.ajax('#{

How to bypass default_url_options?

限于喜欢 提交于 2019-12-11 01:33:27
问题 In my last Rails project I had to overwrite default_url_options in application_controller.rb to always pass a param through every request, like this: def default_url_options { :my_default_param => my_param_value } end Now every url helper attaches a my_default_param at the end of every generated url. For instance user_url(@current_user) generates a url like: http://www.example.com/users/1?&my_default_param=my_param_value But sometimes I need to generate the url without my_default_param . Is

Get value of a specific param - Rails

白昼怎懂夜的黑 提交于 2019-12-10 16:51:23
问题 In a specific controller I have the below list of params: Parameters: {"user"=>"{\"id\":32,\"email\":\"test@test.com\",\"created_at\":\"2014-04-10T13:13:40.000Z\",\"updated_at\":\"2014-04-11T18:10:15.000Z\"}"} How I can get the value of email for example? 回答1: You value looks like json. So try this user_params = ActiveSupport::JSON.decode(params[:user]) user_params[:email] or require 'json' user_params = JSON.parse(params[:user]) user_params[:email] 回答2: You can do params[:user][:email] #=>

Can params be used to pass variables by ref via a function using yield

回眸只為那壹抹淺笑 提交于 2019-12-10 15:57:08
问题 If I have a method that has a params parameter, can it be passed by reference and updated every time a yield is called. Something like this: public static void GetRowsIter(ref params valuesToUpdate) { foreach(row in rows) { foreach(param in valuesToUpdate { GetValueForParam(param) } yield; } } Is that legal? (I am away from my compiler or I would just try it out.) 回答1: No. params just creates an array that contains the parameters being passed. This array, like all others, is just a collection