bourne wrote in post #971508:
>> Right. You should just be able to do Sharedtab.create :user => @user,
>> :tab => @tab...or @user.sharedtabs.create(:tab => @tab)...you get the
>> idea.
>
> Thank you so much!
>
>> And it really should be SharedTab.
>
> I noticed your comment in the last thread and will definitely change
> that. Mine is Sharedtab, you propose SharedTab / Shared_Tab.
SharedTab / shared_tab. Never Shared_Tab.
What is
> Rails convention for that, what about User_Tab? (remark: Sharedtab
> has additional fields as owner, position, ...).
Rails convention expects to have underscore_case for everything except
class names, which are in CamelCase. The autoloader would expect to
find class UserTab in app/models/user_tab.rb . I think User_Tab would
be expected in user__tab.rb (note the extra underscore), but don't
bother.
You can load classes with explicit require statements if you want to,
but why defeat the autoloader?
>
> All the best for 2011!
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment