params

ExtJs4 - Store baseParams config property?

自古美人都是妖i 提交于 2019-11-30 05:04:45
In extjs3.x I used the stores baseParams config property to specify parameters used to load the store. This property no longer exists in extjs 4. What should I do instead of this? Also in extjs3 I was able to specify wether the stores proxy was a GET or a POST method by using the proxy method config property. What should I do instead of this? My ExtJs 3 code -> var store = new Ext.data.JsonStore({ root: 'Data', baseParams: { StartDate: '', EndDate: ''' },//baseParams proxy: new Ext.data.HttpProxy({ url: 'Time/Timesheet', method: 'POST' })//proxy });//new Ext.data.JsonStore You need to use the

Nested params with cURL?

混江龙づ霸主 提交于 2019-11-30 04:46:17
I've got an iPhone app requesting an API, and it uses a nested param structure to pass in a username and password to login. In my Rails controller, I'm successfully retrieving this information normally using: username = param[:session][:username] I'd like to test my API from shell, using cURL. But I can't figure out how to provide nested params? The code below does NOT work... And I've tried multiple variations. But just can't seem to figure it out? curl -d '{"session":{"username":"test","password":"password"}}' http://testurl/remote/v1/sessions Any help, much appreciated! Different frameworks

Include params/request information in Rails logger?

为君一笑 提交于 2019-11-29 23:57:18
I'm trying to get some more information into my Rails logs, specifically the requested URI or current params, if available (and I appreciate that they won't always be). However I just don't seem able to. Here's what I've done so far: #config/environments/production.rb config.logger = Logger.new(config.log_path) config.log_level = :error config.logger.level = Logger::ERROR #config/environment.rb class Logger def format_message(level, time, progname, msg) "**********************************************************************\n#{level} #{time.to_s(:db)} -- #{msg}\n" end end So I can customize

Params IEnumerable<T> c#

冷暖自知 提交于 2019-11-29 23:30:45
Why cant I use an IEnumerable with params? Will this ever be fixed? I really wish they would rewrite the old libraries to use generics... Why cant I use an IEnumerable with params? The question presupposes that the design team must provide a reason to not add a feature to the language. This presupposition is false. Rather, in order for a feature to be used by you it needs to be thought of, designed, specified, implemented, tested, documented and shipped. All of these have large costs. The "params enumerable" feature has been thought of and designed. It has never been specified, implemented,

How to use private submit to hide from profile?

纵饮孤独 提交于 2019-11-29 12:47:44
When a User submits via private how can we hide the submitted info from the feed and from other users being able to see it on his public profile? <%= button_tag(type: 'submit', class: "btn") do %> ... <%= button_tag(type: 'submit', class: "btn", id: "2", name: 'private') do %> ... We put the below in the controller, but since the private button will be in a lot of different _forms, do I have to put it in each controller or can we put it in the application controller? if params[:private] # the private action / What do we need to put here? else # normal submit / and here? I followed this

Passing an array as `params` argument

雨燕双飞 提交于 2019-11-29 10:26:53
I have the following method: void MyMethod(params object[] args) { } which I am trying to call with a parameter of type object[] : object[] myArgs = GetArgs(); MyMethod(myArgs); It compiles fine, but inside MyMethod I args == { myArgs} , i.e. an array with one element that is my original arguments. Obviously I wanted to have args = myArgs , what am I doing wrong? EDIT: Jon Skeet was actually right, the GetArgs() did wrap the thing in an one element array, sorry for stupid question. What you've described simply doesn't happen. The compiler does not create a wrapper array unless it needs to.

Changing the params modifier in a method override

陌路散爱 提交于 2019-11-29 07:33:53
问题 I'm aware that a params modifier (which turns in one parameter of array type into a so-called "parameter array") is specifically not a part of the method signature. Now consider this example: class Giraffid { public virtual void Eat(int[] leaves) { Console.WriteLine("G"); } } class Okapi : Giraffid { public override void Eat(params int[] leaves) { Console.WriteLine("O"); } } This compiles with no warnings. Then saying: var okapi = new Okapi(); okapi.Eat(2, 4, 6); // will not compile! gives an

params overload apparent ambiguity - still compiles and works?

我只是一个虾纸丫 提交于 2019-11-29 05:39:38
问题 We just found these in our code: public static class ObjectContextExtensions { public static T Find<T>(this ObjectSet<T> set, int id, params Expression<Func<T, object>>[] includes) where T : class { ... } public static T Find<T>(this ObjectSet<T> set, int id, params string[] includes) where T : class { ... } } As you can see, these have the same signature except for the params . And they're being used in several ways, one of them: DBContext.Users.Find(userid.Value); //userid being an int?

Rails: Plus sign in GET-Request replaced by space

一笑奈何 提交于 2019-11-29 01:17:06
In Rails 3 (Ruby 1.9.2) I send an request Started GET "/controller/action?path=/41_+" But the parameter list looks like this: {"path"=>"/41_ ", "controller"=>"controller", "action"=>"action"} Whats going wrong here? The - , * or . sign works fine, its just the + which will be replaced by a space. That's normal URL encoding, the plus sign is a shorthand for a space : Within the query string, the plus sign is reserved as shorthand notation for a space. Therefore, real plus signs must be encoded. This method was used to make query URIs easier to pass in systems which did not allow spaces. And

Params IEnumerable<T> c#

岁酱吖の 提交于 2019-11-28 21:20:52
问题 Why cant I use an IEnumerable with params? Will this ever be fixed? I really wish they would rewrite the old libraries to use generics... 回答1: Why cant I use an IEnumerable with params? The question presupposes that the design team must provide a reason to not add a feature to the language. This presupposition is false. Rather, in order for a feature to be used by you it needs to be thought of, designed, specified, implemented, tested, documented and shipped. All of these have large costs.