On 17 November 2010 01:24, Jason Hhh <[email protected]> wrote:
> Can someone explain to me how I create a function in ROR

On 17 November 2010 02:48, Jason Hhh <[email protected]> wrote:
> I have a rails app.  I understand how to create a function in Rails.

I'm a little confused as to what you need, as these two posts seem to
be contradictory.

I agree with the sentiment of Marnen's post; if you're confused at
this stage about how to structure your code in Ruby (hint, there's
very little difference in general terms with *any* other OO language -
differences in idiom, syntax and some functionality, sure - but if you
know Java or C#, you should be able to understand a Ruby class easy
enough. My point here is that your question possibly seems to be
partly about OO programming generally, not Rails specifically) or how
to organise the structure of a Rails application, then there are some
very good primers out there on the WWW, and several highly recommended
books on the subject too.

On 17 November 2010 02:48, Jason Hhh <[email protected]> wrote:
> Is this the proper way to do this?  How do I make sure it's not
> accessible through the through the URL: /Contacts/lock?

I see you now already have a couple of suggestions, and I'll add the
"private" keyword to the mix as another alternative... they're all
choices, but I would prefer the approach of utilising methods on the
model.


PS Please try not to top-post your replies, but to interleave them
with appropriate quotes, to make following the conversation as easy as
possible for readers.

Regards

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to