Displaying 20 results from an estimated 900 matches similar to: "in_vertical_groups_of"
2006 Jul 20
11
3 columns
Hi all,
Not really sure what to put in the title so hope people still open this!
What I want to do is produce something like this
Col1 Col2 Col3
data1 data2 data3
data4 data5 data6
data7 data8 data9
data.. data.. data..
data.. data.. data..
data-n data-n+1 data-n+2
I can get the data back from my db
2007 Dec 27
17
2.0 & "Agile Web Dev..." book
Just running through the first little project (depot) in ''Agile Web
Development with Rails''. It isn''t scaffolding like it says it should
in the book.
After running:
>rails -d mysql depot
then SQLing:
drop table if exists products;
create table products (
id int not null auto_increment,
title varchar(100) not null,
description text not null,
image_url varchar(200)
2010 Mar 04
5
has anybody made actionmailer work with rails 2.3.5?
Hi,
I have wasted few days and I''m not getting anywhere. I was trying to
follow tutorial on Rails Guides and this one:
http://www.tutorialspoint.com/ruby-on-rails/rails-send-email.htm .
All I need is to be able to send some text, nothing fancy. Why in
Rails it has to be so difficult? Why it can''t be so simple as in PHP?
Can anybody point me to some good simple tutorial,
2007 Dec 23
11
return day from date (javascript) ?
Ok, I know this isn''t a Rails problem, but if you could help me out
that''d be brill.
I''ve used JavaScript to create a new Date object containing a date of my
choice...
mydate = new Date("11/24/2007");
//going with Javascript''s mm/dd/yyyy format
now this is good, what i want to do now is put in an integer variable
the number for the day, in this case
2006 May 31
7
Getting 22 elements
Hello,
I''ve done
===
class HomeController < ApplicationController
def index
@country = Country.find(:all, :include => "cities")
end
end
===
And rhtml is:
===
<% @country.each do |country| %>
<h1><%= country.name %></h1>
<% country.cities.each do |city| %>
- <%= link_to city.name, :action =>
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day.
Hopefully someone can help explain why before_filter isn''t working for
my codes.
In my Application controller, I have this:
before_filter :login_required, :except =>
[:newacct, :create_newacct, :passwd_reset ]
def login_required
unless session[:user_id]
flash[:notice] = "Please log in"
2008 Sep 17
13
Capturing the sql from a statement without executing it?
Hi guys,
Is there an elegant way to capture the sql that would have been
executed by an ActiveRecord statement, without actually executing
it? :)
I''m imagining something like
sql = User.find(1).groups.to_sql
or perhaps
sql = ActiveRecord::Base.capture_sql { User.find(1).groups }
resulting in sql = ''SELECT * FROM groups INNER JOIN memberships....
WHERE users.id =
2008 Nov 03
17
SQL queries in Rails
Hi...
I want to know the equivalent instructions to insert, update, search
and delete a registry. I know Rails can do it easily Thanks to
ActiveRecord, but here''s the catch: I''m using PostgreSQL. As I''m using
SQL to do the migration (Including the foreign keys), I need to know
if I can use SQL queries to do those actions. Is there an example out
there?
I uncommented
2008 Jun 10
7
ActionMailer undefined method `parameters' - Rails 2.1
Hello Rubyists,
I''m currently trying to get email hooked up via ActionMailer, and while
I''ve gotten it to work in the past on Rails 1.2.x, I''m seeing an error
that I''m unfamiliar with.
Right now, I''m just trying to send email from my dev box via the SMTP
server at work.
My development.rb file:
#...snip
config.action_mailer.delivery_method = :smtp
2009 May 27
4
Scaffolding Results Format
Hi Everyone,
I built a scaffold and I''m having trouble getting results properly
formatted. (I need to get the data into multiple columns instead of just
one big column) I can''t get all of my CSS to work properly in
scaffold.css, layout/books.rhtml, or the books/index.rhtml.erb Anyways,
maybe you have a suggestion.
Default view (127.0.0.1:3000/books)
Title Abstract
2007 Dec 28
11
LIKE clause in rails
Hello,
I am trying to achieve a search functionality in the following manner
i have an table called people
which has
first_name,last_name,etc...
After the user form to search people is submitted i get the params hash
as params[:persons]={"first_name"=> "%John%","last_name"=>"%Stevens%"}
NOTE : I have changed the params hash to include the %.
Now
2008 Apr 04
6
validates_numericality_of :not_equal_to
I have a situation in which I want to validate a number is not zero.
Both positive and negative values are acceptable, just not zero.
validates_numericality_of has an :equal_to attribute, but I don''t see a
:not_equal_to. I have not yet been able to find anyone who has
discussed this. I did find information about custom validators, so I am
now using a custom validator to check the field
2007 Dec 24
5
output link_remote_to in helper
Hi all,
I have a complex link_remote_to link I need to generate often. I want
to DRY up my view and create a helper that generates this
link_remote_to for me.
Is there a way my helper can output the link_remote_to javascript?
Thanks
STijn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Apr 09
6
Write/Display AR query as Grouped Results?
I''ve got a publications table that contains an author_id foreign key and
a pubrole_id foreign key. What I want to do is query the DB using AR so
that I can get a list of all publications that belong_to a particular
author, and group the results by the pubrole.role_name (Author, Joint
Author, Editor, etc.) so that the results look something like:
Author
book1 info
book2 info
etc.
2006 Sep 01
0
Are you using Array#in_groups_of(n, false)?
Are you using Array#in_groups_of(n, false)? That is, you want the
array chopped into n groups, and if its an uneven number, you want the
missing positions filled with "false". If so, please post the brief
snippet where it is being used.
(I''m trying to settle a bet with Mr. koz.)
--
David Heinemeier Hansson
http://www.loudthinking.com -- Broadcasting Brain
2010 Apr 30
0
using in_groups_of to get data to display horizontally
Hey all,
The following has two columns. Each column has a head with a name and
then a data cell with a time directly below it. I''m wondering how I can
get the time to display next to the name, not below it.
- @clock.in_groups_of(2) do |group|
%tr.header
- group.each do |item|
%th= item.name
%tr
- group.each do |item|
%td
2009 Mar 08
1
Working with in_groups_of
I''m trying to build a table out using in groups of, but I''d also like to
be able to customize the first and last rows.
Apart from the actual formatting, is there an efficient way to figure
out how many total groups there are and what group the iteration is in?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2006 Jul 19
1
Displaying data in a table
I''m trying to display a series of pictures in a table. Rather than just
house each of the pictures in separate rows, I''d like to have 5 pictures per
row. So, basically after I iterate through five columns in my table, I need
to start a new row and show the next 5 pictures.
Could someone help me with the looping structure I''d need to create to do
this?
Thank you!
Sarah
2006 May 03
2
grouped output
hello,
Suppose I have a table that looks like this:
center name email
Health Jon jon@test.com
Health Bob bob@test.com
Admin Jane jan@test.com
Admin Jill jill@test.com
I would like the output to look like this:
Health
Jon jon@test.com
Bob bob@test.com
Admin
Jane jan@test.com
Jill jill@test.com
when i using cold fusion, this was easy via a tag called cfoutput.
when i was using java, this was
2010 Oct 15
3
Noughts and Crosses layout with a variable number of entries
I have a product listing of 9 per-page. The products on the far right
and bottom row should NOT have a border on the aforementioned sides. So,
similar to a noughts and crosses layout. However, pages do not always
have 9 products to display.
You may have a better understanding if you see the code I''m currently
using: http://pastie.org/1223260
The code above is passed inside a block and