[Rails] Re: Change label based on selected dropdown [Ruby on Rails 4.2]

2016-05-24 Thread Marcus Chia
I am getting the current error in js console, TypeError: network_details[network_index] is undefined help? -- 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

[Rails] Change label based on selected dropdown [Ruby on Rails 4.2]

2016-05-24 Thread Marcus Chia
my SO Link http://stackoverflow.com/questions/37416737/change-label-based-on-selected-dropdown-ruby-on-rails-4-2 I have a table called network it has the column type and number. I use this select_tag to get a list of all my network names: <%= select_tag('NetworksList', options_from_collection_fo

[Rails] ActionCable, Forms & CSRF

2016-05-24 Thread Dave Bell
I have a search view which collects a search term from a user and then passes them to the search result view. The results view is constructed in two parts: 1) basic server side rendering which builds the overall structure of the page and includes a search form 2) ActionCable delivers rendered

Re: [Rails] Polymorphic associations for comments or no?

2016-05-24 Thread Greg Navis
I think it depends on your use case. Things to consider: 1. Selecting all comments of a user via 1 association or N associations (and 1 vs N queries). 2. Storing more data in the table (:commentable_type). 3. Maintaining and testing one model vs testing N models. I think the biggest problem with

[Rails] Re: Serialized attributed with native hash is saved as !ruby/hash:ActiveSupport::HashWithIndifferentAcce

2016-05-24 Thread Frederick Cheung
On Monday, May 23, 2016 at 1:12:33 PM UTC+1, Alessio Varalta wrote: > > If i put in the model > > > serialize :birthplace, Hash > > > is correct but i have a diffrent format {:it=>"Padova",:de=>"Padovan"} > > > I read in the last part of this document > > > http://apidock.com/rails/ActiveRecord/A

Re: [Rails] establish_connection is slow

2016-05-24 Thread Colin Law
On 23 May 2016 10:05 p.m., "saurabh verma" wrote: > > Hey Guys, >I am running a service which has one controller action. I am connected to external db. For any db query, I am getting slow response. Looks like execution time is ok, but still there is some other delay which I am not able to figu