Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Re: [Rails] Rails 4.0 Example app

158 views
Skip to first unread message

Jason Fleetwood-Boldt

unread,
Mar 19, 2013, 4:22:23 PM3/19/13
to rubyonra...@googlegroups.com


Have you tried http://railscasts.com

He covers many of the things you asked about in various episodes. 



On Mar 18, 2013, at 3:32 PM, 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 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 release.

I am sure that it would take no more than 15 minutes of someone within the core team to produce an app that provides just the basic of use cases:

  1. Edit of multi-level nested attributes in a single form.
  2. Edit several models on the same form.
  3. Edit multiple records from a single model on the same form.
  4. Basic authentication.
  5. Digest authentication.
What do you think ?

P.S. On ubuntu using rvm Ruby 2.0 and Rails 4.0.0.beta1 and Ruby Mine 5.0.2 the installation of each went without any problems.  I just cannot find how to implement the simple examples listed above with Rails 4.


--
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 rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/z_GFlbTlatAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

jle...@socit.co.uk

unread,
Mar 20, 2013, 7:35:37 AM3/20/13
to rubyonra...@googlegroups.com
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 that of newcomer accessibility.  TDD may make a development more agile but there is nothing better than an example app that exercises all the simple/minimum/core functionality and use-cases.

Just how long do you think it would take a true expert involved in edge rails development to write a small app  ?

I suspect that it does'nt exist because it is too hard to do.

Another point is that an example app is like a picture being worth a thousand words. It proceeds the documentation lag and displays a best practice approach that is clearly comprehensible by a much broader ability level.

I would gladly write one and give it back to the community if I could get it all to work and if I was sure that my approach was in line with the current version of rails best practice.

An example app should execute without error and be a minimum requirement before a new release is issued.  This is another example where TDD has pushed out verifying the basic use-case requirements.

Sorry if this sounds like a rant but I am almost at the end of my tether after giving up on rails 2.x, starting again on 3, and again on 3.2 and now on 4.0.0.beta1.  Rails is becoming so agile that you are lucky to complete an application before the next version is released.

Just one last time - can anyone knock out a simple app displaying core use-cases I have highlighted ?

tamouse mailing lists

unread,
Mar 20, 2013, 9:29:41 PM3/20/13
to rubyonra...@googlegroups.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 rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/rubyonrails-talk/-/2MHp73ESuvAJ.
>
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Sounds like it could be helpful. Go for it!

jle...@socit.co.uk

unread,
Mar 21, 2013, 8:20:09 PM3/21/13
to rubyonra...@googlegroups.com
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

    <div>
        <h2><%= f.label r %></h2>
        <%= f.fields_for :interactions, s.initialized_interactions() do |builder| %>
            <% role = builder.object.role %>
            <%= builder.hidden_field :role_id %>

            <div class="field">
                <%= builder.check_box :enable %>
                <%= builder.label :enable, role.name %>
            </div>
        <% end %>
    </div>

 So the above renders OK for 3.2 but under rails 4.0 'builder.object' is an array of role objects and of course it fails.

Any ideas ?

Jussi Hirvi

unread,
Mar 23, 2013, 3:37:58 AM3/23/13
to rubyonra...@googlegroups.com
On Friday, March 22, 2013 2:20:09 AM UTC+2, jle...@socit.co.uk wrote:
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

    <div>
        <h2><%= f.label r %></h2>
        <%= f.fields_for :interactions, s.initialized_interactions() do |builder| %>
            <% role = builder.object.role %>
            <%= builder.hidden_field :role_id %>

            <div class="field">
                <%= builder.check_box :enable %>
                <%= builder.label :enable, role.name %>
            </div>
        <% end %>
    </div>

 So the above renders OK for 3.2 but under rails 4.0 'builder.object' is an array of role objects and of course it fails.

Any ideas ?

Have you tried to display builder.object on screen, or in rails console? If you do it both in 3.2 and 4, you should be able to see if there is a difference. 

jle...@socit.co.uk

unread,
Mar 24, 2013, 7:12:35 AM3/24/13
to rubyonra...@googlegroups.com
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.

Jussi Hirvi

unread,
Mar 24, 2013, 8:34:36 AM3/24/13
to rubyonra...@googlegroups.com
On Sunday, March 24, 2013 1:12:35 PM UTC+2, jle...@socit.co.uk wrote:
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.

Depends on the array structure. I can only advise that you read the array specs


(assuming you use 1.9.3). There you shold find methods to display your array elements. 

- Jussi 

jle...@socit.co.uk

unread,
Mar 24, 2013, 9:34:07 AM3/24/13
to rubyonra...@googlegroups.com
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.

jle...@socit.co.uk

unread,
Mar 27, 2013, 12:24:39 PM3/27/13
to rubyonra...@googlegroups.com
Hi All,
See https://github.com/ozpos/urps2 - still struggling with use case 2.
Reply all
Reply to author
Forward
0 new messages