It sounds like you are looking for something like ActiveRecord's
find_or_create_by...() or find_or_initialize_by...() methods.
You might look into "Dynamic attribute-based finders" on
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
--
You received this message because you are subscribe
You might want to try an after_find() or after_initialize() filter for
ActiveRecord. If I remember right they'll let you coerce the value to
an integer before the object gets returned to the calling code.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails
Since you didn't say what the problem was, I'll take a shot at it.
It looks like HAML to me. If it is, it looks like you should use
the :javascript filter instead of trying to build a
Search for ruby + libcurl for other suggestions, but patron might do
what you want.
http://github.com/toland/patron
http://www.rubyinside.com/patron-a-simpler-ruby-http-client-2067.html
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To
I'm not going to create an account to snoop around so you'll need to
give more information so we can give better suggestions. Without
seeing the HTML for the form and cookies and the URL they send you
it's hard to say, however they could be storing a session key in a
hidden field or in a cookie. Th
Use Nokogiri::HTML.fragment(str).
On Nov 11, 5:27 am, "Al F." wrote:
> Hello,
>
> I'm trying to use nokogiri gem to parse individual xhtml tags (not the
> whole html document) and preform some processing on them.
>
> Heres an example of a string that I want to process:
>
> str = ' src="http://
What have you written so far and why do you think it didn't work?
On Sep 7, 8:43 pm, prashanth hiremath
wrote:
> I have an html like
>
> Red<..
> blue...
>
> I have to write code in such way that i wanna search text until
>
> between 2 span Ex: ...
--~--~-~--~~
:conditions => ['body LIKE?' AND 'title LIKE?', "%#{search}%"]
Try fixing the condition clause to:
:conditions => ['body LIKE ? AND title LIKE ?', "%#{search}%", "%#
{search}%" ]
You are passing an array containing the SQL "WHERE" clause in a
template. Each '?' is a placeholder for th
Doesn't "ORDER BY tstamp" need to be "ORDER BY tstamp DESC"? The
latest 10 need to be captured, not the oldest 10.
On Aug 14, 10:19 pm, Marnen Laibow-Koser wrote:
> RVince wrote:
> > Yes, I can see there is no easy, rails-way to do this. In effect, I
> > need to
>
> > 1. read in the X most recen
9 matches
Mail list logo