[Rails] SOLVED - Re: Rails 4.0 has_many_through and fields_for

2013-03-27 Thread jleake
See https://github.com/ozpos/urps2 - use case 1 On Sunday, 24 March 2013 12:20:49 UTC, jle...@socit.co.uk wrote: > > Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and > nested attributes. > > class ControllerAction < ActiveRecord::Base > has_many :interactions, de

[Rails] Re: Rails 4.0 Example app SOLVED use case 1

2013-03-27 Thread jleake
Hi All, See https://github.com/ozpos/urps2 - still struggling with use case 2. On Monday, 18 March 2013 19:32:57 UTC, jle...@socit.co.uk wrote: > > Hi All, > I have 30 years as a self employed software engineer and have been > experimenting with rails for several years but !! > > I would have mad

[Rails] Re: Rails 4.0 has_many_through and fields_for

2013-03-24 Thread jleake
Hi, That is what happens now in models/controller_action.rb def initialized_interactions() # this is the key method [].tap do |o| Role.all.each do |r| if p = interactions.find { |p| p.role_id == r.id } o << p.tap { |p| p.enable ||= true } else

[Rails] Re: Help to send email required

2013-03-24 Thread jleake
Hi, Sorry I do not know. This also confused me. Try using a name associated with your email service provider. It should not have anything to do with where your app server is running from. John On Sunday, 24 March 2013 09:11:15 UTC, Tommy Pollák wrote: > > From a Rails application containing e

[Rails] Re: Rails 4.0 has_many_through and fields_for

2013-03-24 Thread jleake
So what should be returned instead ? On Sunday, 24 March 2013 12:20:49 UTC, jle...@socit.co.uk wrote: > > Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and > nested attributes. > > class ControllerAction < ActiveRecord::Base > has_many :interactions, dependent: :d

[Rails] Re: Rails 4.0 Example app

2013-03-24 Thread jleake
Hi Jussi, Thank you for the suggestion. Ruby 2.0. The problem is that an array is returned whereas rails 3.2 you get an Interaction object. I cannot figure out how to generate hidden fields and check boxes that will be accepted by the update. On Monday, 18 March 2013 19:32:57 UTC, jle...@socit.

[Rails] Re: Help to send email required

2013-03-24 Thread jleake
mailers/user_mailer.rb class UserMailer < ActionMailer::Base default from: "youremailaddress" # Subject can be set in your I18n file at config/locales/en.yml # with the following lookup: # # en.user_mailer.password_reset.subject # def password_reset(us

[Rails] Rails 4.0 has_many_through and fields_for

2013-03-24 Thread jleake
Hi all, I am trying to reproduce rails 3.2 behaviour with fields_for and nested attributes. class ControllerAction < ActiveRecord::Base has_many :interactions, dependent: :destroy has_many :roles, through: :interactions scope :controllers, lambda {|name| where("controller_n

[Rails] Re: Rails 4.0 Example app

2013-03-24 Thread jleake
Yes I have, for some reason the builder object is an array under rails 4.0 and I have not found a way of presenting the view for edit. On Monday, 18 March 2013 19:32:57 UTC, jle...@socit.co.uk wrote: > > Hi All, > I have 30 years as a self employed software engineer and have been > experimentin

[Rails] Rails 4.0 Example app - fields_for

2013-03-21 Thread jleake
So I have a rails 3.2.11 Example app that exhibits some simple core use cases and I am starting again under rails 4.0.0.beta1 ** <%= f.label r %> <%= f.fields_for :interactions, s.initialized_interactions() do |builder| %> <% role = builder.object.role %>

[Rails] Re: Learning Rails - Advice for development environment

2013-03-20 Thread jleake
Hi Michael, I think the problem may be with the hardware being too new. Some lap tops have good comparability with mainstream linux distros. I had better success with older hardware and although they run slow under windows (which is by design by M$) they run quite fast under linux. For example

[Rails] Re: Rails 4.0 Example app

2013-03-20 Thread jleake
Thank you for the suggestion, yes of course I would have given up years ago without RBs fantastically clear material. However edit multiple does not work on multi-level nested attributes. Yet edit a single multi-level nested attribute (using update_attributes) works fine. My main point is th

[Rails] Re: Best IDEs for Ruby on Rails

2013-03-19 Thread jleake
RubyMine 5.0.2 Fabulous IDE, excellent value for money, superb debugging with code coverage and VCS integration, stack analysis, object tree view, model diagrams, db integration and lots more. I think the obsession with the command line just overwhelms you with detail, a bit like looking at the

[Rails] Rails 4.0 Example app

2013-03-19 Thread jleake
Hi All, I have 30 years as a self employed software engineer and have been experimenting with rails for several years but !! I would have made considerably more progress and been able to give back to the community if only there was a demo application that was released with each new rails releas