params

[c#] passing a object[] to a params object[] not working

Hi, I've read the topic about passing an object[] to a params object[] but I don't know why it's not working with me. I have these too functions in a class: ... private void CallbackEvent(object source, CallbackEvetArgs e) { // Some event with e.Data as string ... string[] values = e.Data.Split('|'); DoSave("s...

Can I change the assignment order for new model instances in rails.

I have two attributes, 'a_value' and 'b_id'. (Not their real names.) 'a_value' is stored on the file system, using some information from model 'B', referenced by 'b_id'. So, my params object looks like: params[:foo] = {"a_value"=>"nifty value","b_id"=>"38"} for example. Now, in foo_controller.rb: foo = Foo.new(params[:foo]) But t...

Insert cakephp POST params into URL

Hi, I have this form below which contains two checkboxes to sort some products: <form id="FiltreExtraForm" action="" method="post" name="FiltreExtraForm"> <input id="ProductsDeliveryPrice" type="checkbox" value="1" name="data[Products][delivery_price]"/> <input id="ProductsPicture" type="checkbox" value="1" name="data[Products][pictu...

C# params keyword with two parameters of the same type

I just encountered something with C# today that I hadn't thought of before. I have two methods in my class, one an overload of the other. They are declared like so: 1) public void RequirePermissions(params string[] permissions)... 2) public void RequirePermissions(string message, params string[] permissions)... In my code, I tried to ...

How to create one form with many possible actions in Rails?

I want to create one form with 2 buttons in rails. Both forms operate on the same data in different ways, and I would prefer to keep the associated functionality in two different methods. Previously I've redirected to the appropriate method after doing a string comparision on params[:commit], but my gut says there's a better approach. Su...

jquery to goto a url on form submit with field values added to the url string

Hi All, I'm fairly new to jquery and I think this is simple but I'm struggling and google doesn't seem to be helping.... What I have is a basic form... <form> First Name: < input type="text" name="firstName" id="firstName" /> Surname: < input type="text" name="surname" id="surname" /> <input type="submit" id="submit" value="submit"/> ...

Disabled/Custom params_parser per action

Hi, I have a create action that handles XML requests. Rather than using the built in params hash, I use Nokogiri to validate the XML against an XML schema. If this validation passes, the raw XML is stored for later processing. As far as I understand, the XML is parsed twice: First the Rails creates the params hash, then the Nokogiri pa...

How do I make the params keyword usage similar to writing to the Console

In relation to my last question (http://stackoverflow.com/questions/1588135/is-there-an-easier-way-of-passing-a-group-of-variables-as-an-array) I was trying to pass string variables to a method to write to a stream, rather than doing the writing in each individual method. The use of the params keyword is obviously a solution, however b...

Using # in links instead of GET params = faster?

I just noticed that say http://s7.addthis.com/js/250/addthis%5Fwidget.js#pub=PUBID does the equivalent of http://s7.addthis.com/js/250/addthis%5Fwidget.js?pub=fct-250 but is much faster. How does that work? O_o I'm including the above links in a < script src call. Its supposedly faster according to one of the addthis developers. ...

How to use complex Type params argument in Spring.NET constructor

I am trying to use Spring.NET with a C# application to populate a parameter array (params keyword) constructor argument that is of a complex Type (call it SecretCode, which happens to be an enumerated type.) Can someone help point me to the documentation to configure the XML file to do this? For reference, here are relevant code snippe...

JSP Portlet not submitting form values

Hi, I am using Liferay portal 5.x. I have deployed a simple portlet ( uses jsp & servlet extending GenericPortlet). This portlet will contain username & password field. I am able to see the form in view mode. But when i submit the form, the action is coming to processAction() of the Portlet class but the username & password request para...

how do you compare a param to every item in an array in rails?

i have a codes model and i a basically have a form wich should authenticate simply to every code recorded so my controller is: def cancel_sale @codes = Code.find(:all) @codes.each do |c| @code = c.name end if params[:auth] && params[:auth] == @code something else @mensaje_de_salida = "wrong auth code" en...

Individual Form Params when POST data is split

I'm trying to access a date variable from a form individually to the other variables. The form is a formtastic plugin form. The issue I am facing is that the date is a three-part dropdown and simply doing params[:friend][:born_on] doesn't seem to be doing the trick as it returns NULL. Here is my parameters output; Parameters: {"comm...

[C#] Interesting "params of ref" feature, any workarounds?

I wonder if there's any way something like this would be possible for value types... public static class ExtensionMethods { public static void SetTo(this Boolean source, params Boolean[] bools) { for (int i = 0; i < bools.Length; i++) { bools[i] = source; } } } then this would be possible: Boolean a = true, b, c = true, d...

Rails RESTful Routes: override params[:id] or params[:model_id] defaults

Hello, I'm trying to understand how to change this rule directly on the map.resources: supposing I have a route: map.resource :user, :as => ':user', :shallow => true do |user| user.resources :docs, :shallow => true do |file| file.resources :specs end end so I would have RESTful routes like this: /:user/docs /docs/:i...

PHP: Array to variable function parameter values

I have a variable length array that I need to transpose into a list of parameters for a function. I hope there is a neat way of doing this - but I cannot see how. The code that I am writing will be calling a method in a class - but I will not know the name of the method, nor how many parameters it has. I tried this - but it doesn't w...

Variable symbol in Params object in rails

Hi all I have the following code: @profile.update_attributes(params[:xxxx_profile]) where xxxx stands for either male or female. Basically the form submit passes either a set of female_profile[foo] or a male_profile[foo] and i want to change it accordingly. Assuming I have a string that can be inserted in lieu of xxxx, how do I dyn...

rails routes params find for a form

Hello, I am having a bit of trouble with my rails application. It short, its a social networking app where users have a profile, have submissions, and can comment on submissions. My routes are as follows: map.connect '/:username', :controller => 'users', :action => 'show' map.connect '/:username/:id', :controller => 'submissions', :...

how can I hide params I transmit to a method (like form_for seems to do)?

Hi, I've been searching for hours now and haven't found anything that helps. What I want to do: I need to call the check_login-Method (as below), which needs parameters. redirect_to check_login_users_url( :user => {:name => input[1], :password => input [2] }, :stylesheet => 'scaffold', :method => :get) The point is that thes...

Encode params used within a post

Hello Experts! I need to encode the params to ISOLatin which i intend to post to the site. I'm using org.apache.http. libraries. My code looks like follows: HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost("www.foobar.bar"); post.setHeader("Content-Type", "application/x-www-form-urlencoded"); HttpPa...