Array
(
[startpos] => 1
[where] => AND i.iblog = 1 AND i.inumber IN (43,44,45,46,47)
[total_pages] => 1
[total_items] => 3
[page_amount] => 5
[current_page] => 1
[offset] => 0
[prev_page] => 1
[next_page] => 1
[first_link] => http://ebullientworks.com/tag/ruby/page_1
[last_link] => http://ebullientworks.com/tag/ruby/page_1
[prev_link] => http://ebullientworks.com/tag/ruby/page_1
[next_link] => http://ebullientworks.com/tag/ruby/page_1
)
SELECT i.inumber as itemid, i.ititle as title, i.ibody as body, m.mname as author, m.mrealname as authorname, i.itime, i.imore as more, m.mnumber as authorid, m.memail as authormail, m.murl as authorurl, c.cname as category, i.icat as catid, i.iclosed as closed FROM nucleus_item as i, nucleus_member as m, nucleus_category as c WHERE i.iblog=1 and i.iauthor=m.mnumber and i.icat=c.catid and i.idraft=0 and i.itime<="2008-12-05 04:16:41" AND i.iblog = 1 AND i.inumber IN (43,44,45,46,47) ORDER BY i.itime DESC LIMIT 1,5
stdClass Object
(
[itemid] => 46
[title] => Rails: Printing validation errors as flash notices
[body] => I am quite sure someone has already found this simple solution, but when I poked around, I couldn't find it.
Here is my snippet to print out the error messages resulting from a validation as a flash notice:
if @user.save
flash[:'notice'] = "New user saved successfully."
elsif !@user.errors.empty?
flash[:'notice'] = "Could not save new user: "
<< @user.errors.full_messages.join("; ")
end
[author] => erin
[authorname] => Erin Schnabel
[itime] => 2006-07-11 18:43:00
[more] =>
[authorid] => 1
[authormail] => erinschnabel@gmail.com
[authorurl] => http://ebullientworks.com/
[category] => General
[catid] => 1
[closed] => 0
)
Tuesday, 11 July 2006
I am quite sure someone has already found this simple solution, but when I poked around, I couldn't find it.
Here is my snippet to print out the error messages resulting from a validation as a flash notice:
if @user.save
flash[:'notice'] = "New user saved successfully."
elsif !@user.errors.empty?
flash[:'notice'] = "Could not save new user: "
<< @user.errors.full_messages.join("; "
end
posted by
erin at 06:43 PM
in
General
tags:
ruby /
rails
stdClass Object
(
[itemid] => 43
[title] => Ruby and Rails.
[body] => So. I'm fiddling. again. with Ruby on Rails. because it's trendy.
I have to say, it's also handy. Very nice not to have to write the entire DB framework just to make an app! The problem that I have is I'm such a habitual programming dork that I find Ruby's syntax a little odd...
[author] => erin
[authorname] => Erin Schnabel
[itime] => 2006-03-05 13:53:00
[more] =>
- Ruby Language
- Ruby on Rails
- Tutorials
- Cheat Sheets
- Using Relational DB
- Migrations
[authorid] => 1
[authormail] => erinschnabel@gmail.com
[authorurl] => http://ebullientworks.com/
[category] => General
[catid] => 1
[closed] => 1
)
Sunday, 05 March 2006
So. I'm fiddling. again. with Ruby on Rails. because it's trendy.
I have to say, it's also handy. Very nice not to have to write the entire DB framework just to make an app! The problem that I have is I'm such a habitual programming dork that I find Ruby's syntax a little odd...
»
Read More
posted by
erin at 01:53 PM
in
General
tags:
ruby /
rails