[Rails] LOOP ARRAY OF HASHES

2015-06-16 Thread Simon Eric
Please how can i loop this to have all values of _id, contact, sent, answer, repondant? { result : [ { _id : null, contact : 45684, sent : 0, answer : 0, repondant : 0 }, { _id : vms,

[Rails] NET/HTTP GET VALUE

2015-03-07 Thread Simon Eric
I have two app in rails that communicate between net/http: In the first app controller is something like so: class WebservicesController ApplicationController require 'net/http' require uri layout 'admin' def ws uri = URI(http://localhost:3001/api/ws;)

[Rails] Keep data on the field after submit a form with error

2015-02-07 Thread Simon Eric
After validation, I got error and return back to :action = :new. Some field on form already filled, so I want to keep them filled after error message too. How it can be done in rubyonrails4? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to

[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-30 Thread Simon Eric
I resolved that problem. I done somethig like so to update each column: def update_multiple @postis = Posti.find(params[:posti_ids]) @postis.each do |posti| posti.update_column(:stato, params[:posti]) end redirect_to prenotazione_path(params[:spectacle_id]) end %=

[Rails] SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
i want to associate one model with 4 models. For example i call a first model Spectacle and call others Hall1, Hall2, Hall3 and Hall4. All of Halls have the same attributes: id and seat. Each Hall have 10 seats. I want to create an spectacle on the database and associate it with any Hall.

[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Thank you very much Jesse! -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Thank you very much Colin. I will try that :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To unsubscribe from this group and stop receiving emails from it, send an email to

[Rails] Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Colin i try what you tell me. It work find. Thank very much. The next step is that: if an user choice the seat on the hall, it must not be appear againt on the view. I have some view like this: %= form_tag( riepilogo_path, method: post, id: sel) do % %= hidden_field_tag sala, params[:sala]

[Rails] Re: Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
Please i try this: @postis.update_column(stato: checked) but i have error like so: undefined method `update_column' for #Array:0xb7a50e8 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To

[Rails] Re: Re: Re: SPECIALS RELATIONSHIP!?

2014-05-28 Thread Simon Eric
@postis is an string. Now i see where i the problem. I fix them like so: def posti_multiple @postis = Posti.find(params[:posti_ids]) a=Posti.find_by(numero: params[:posti_ids]) a.update_column(:stato, checked) end When i have for example posti_ids[ any number], one seat