Displaying 4 results from an estimated 4 matches for "table_class".
2005 Aug 23
0
Fixtures: pluraly bitten
...arization.
I won''t go so far as to say that plurals are bad, but their handling in
Rails is blatant violation of the DRY principle.
Fixtures has a method for resetting PostgreSQL sequences
def self.reset_sequences(connection, table_names)
table_names.flatten.each do |table|
table_class = Inflector.classify(table.to_s)
if Object.const_defined?(table_class)
pk = eval("#{table_class}::primary_key")
if pk == ''id''
connection.execute(
"SELECT setval(''#{table.to_s}_id_seq'', (SELECT MAX(id) FRO...
2006 Mar 15
0
Grid making helper in view
Hello,
I apologize if this has been asked before.
I am interested in creating a helper for my view that generates a
grid-style table. Here''s what I have in application_helper.rb:
def print_grid_layout(items, table_class, num_columns)
print %Q{<table class=''#{table_class}'' cellpadding=''0'' cellspacing=''0''>\n}
rows = Array.new
# creates an array of arrays containing num_column items
num_columns.times do
rows << items.slice!(0..num...
2006 Jul 20
1
Ajax and observe_field not updating specified DIV
...The method is invoked in my controller when i select a choice in
the dropdown and I have an rjs file which is then invoked. The rjs file
looks like this:
page.replace_html ''embed_calendar'', :partial => ''shared/calendar'', :year
=> 2006, :month => 5, :table_class => "calendar_helper"
So, I''m assuming that the _calendar.rhtml will be rendered in the
embed_calendar div.
My controller uses a template called main so i have a main.rhtml which
has multiple partials in it for various sections of the page - all with
their own divs. Then...
2006 Jul 20
0
RJS and calendar_helper troubles .... tab characters covering web page
...modify_month_view.rjs
page.replace_html ''embed_calendar'', :partial => ''shared/calendar'',
:year => 2006, :month => 5
shared/_calendar.rhtml partial
<hr>
<%=
calendar({:year => 2006, :month => 11, :table_class =>
"my_calendar_helper"}) do |d|
cell_text = "#{d.mday}<br />"
cell_attrs = {:class => ''my_day''}
@events.each do |e|
if e.tour_start_date == d
cell_text...