Displaying 20 results from an estimated 2000 matches similar to: "Rewriting URLs - help needed"
2006 Sep 07
6
Template "specialisation"
I want to use a sitewide default template and use a specific version in some
controllers to have a good DRY approach to my layout. Those controllers
should add a little bit more HTML before rendering the results of the
actions, in order to avoid copying the entire sitelayout every time.
How can I do that? Currently my code is like this:
class WelcomeController < ApplicationController
2006 Aug 13
3
Logging in Rails
This is a newbie question, I have a class which is not derived from
ActionController or ActiveRecord but I want to use logging, I tried require
but still logging does not work -
This class is located in a file in "model" directory.
------------------------------------
require ''logger''
class Cart
def add_product(product)
logger.info("Searching for product
2006 Mar 16
9
Baffling AJAX issue
Ok, I''ve got some link_to_remote stuff working elsewhere just fine, but
this time it''s doing something very screwy. Here''s the view code to
create a link to remotely toggle a boolean value on a record:
<td class="contact_active">
<%= link_to_remote "<div id=''contact_active_#{cm.id}''><span
2006 May 17
10
HABTM << producing incorrect insert sql ?
Greetings railsers -
I''m trying to add to a collection through HABTM, but the sql
insert is trying to insert a PK rather than letting mysql produce the
auto_increment''ed PK.
## @medication_dose holds a validated, saved model
@medication_dose.medication_frequencies << MedicationFrequency.find
(:all)
The above bails with,
Mysql::Error: #23000Duplicate
2006 Jul 24
5
Actionmailer sending many emails in same SMTP connection?
Hi,
I need to implement a mailing list system,
Actionmailer is great, but i haven''t found out a way to send many
(hundreds of) emails without having to reconnect to the SMTP server for
each mail when calling
Mymailer::deliver_my_mail(recipient)
Any tips?
(Possibly without calling directly Net::SMTP, so i can take advantage
of the rhtml rendering of the body)
Thanks,
Best regards,
2006 Apr 25
5
Rails using Ruby that ships with RHEL 4
Hi,
RHEL 4 ships with Ruby 1.8.1. I take it that won''t work with Rails 1.1.2?
Thanks,
Joe
2006 May 06
3
[BUMP] conditional require? conditional action code?
Greetings all.
I have some controller code that uses win32ole (only available on
windows). This code is now solid, and I''d now like to resume
development on (any) other OS(grin).
But alas, the controller bails because the OS specific library can''t
be found.
Can I conditionally specify action code compilation (and a require
''win32ole'') based on OS or
2006 Aug 17
3
Migrations for migrating data across databases - is it possible?
Hi All
I am trying to understand if I can use migrations to migrate data under the
following conditions
1. Across 2 different databases (Oracle/DB2) with same schemas.
2. Across 2 different databases (Oracle/DB2) with different schemas.
I am trying to avoid writing DBI/OCI8 scripts.
Can somone please shed some light if this is even possible?
thanks
-daya
-------------- next part
2007 Mar 12
2
utc
I''m having a helluva time getting Date.today.utc to resolve -
"undefined method `utc'' for #<Date: 4908343/2,0,2299161>"
model usage in before_create filter is :
activated_at = Date.today.utc
I''m not stubbing out Date (should I be? [ stub(Date, :utc =>
Date.today) didn''t help any ].
The before filter is working fine within the app, but
2006 Jun 24
5
Why is rails using DB objects that don''t exist?
I admit it--I''m newb right now. But only to rails, ruby and friends.
I''m walking through a "recipe" tutorial but have been stuck for hours;
it''s time to ask for help. On Windows I''ve got the latest ruby, rails,
and webrick; I''ve got the Oracle OCI "thing" to talk to our Oracle 10g
database, I''ve got Slick Edit and a
2006 Jul 04
3
Engine Not Starting
I''ve used login_engine successfully before with webrick, and now using a
provider that uses fcgi. login_engine doesn''t seem to start up, in the
development log file, I get only routing errors for the page requested.
The login_engine unit tests pass fine.
My question is if an engine is not loaded, not in a path, etc, how is
this indicated in rails? None of the log files even
2006 Jun 24
5
request.xhr? vs. respond_to
Searched around this forum, but didn''t find an answer for this question.
Can you help this newbie understand any overlap and/or difference
between request.xhr? and respond_to?
If request.xhr? is true, should I expect it wants.js below?
respond_to do |wants|
wants.html { redirect_to(person_list_url) }
wants.js
wants.xml { render :xml => @person.to_xml(:include
2006 Aug 16
14
Migrations: only one table per migration file?
Hi all
I have a new migration file created that adds some tables and fills one
with some data:
create_table :sound_styles do |t|
t.column :name, :string, :null => false
end
create_table :show_types do |t|
t.column :name, :string, :null => false
end
create_table :countries do |t|
t.column :name, :string, :null => false
end
ActionView::Helpers::FormOptionsHelper::COUNTRIES.each
2006 Jan 03
2
Pdf::Writer ; page numbering, and table wrapping
Hey there,
I know this isn''t a pdf::writer list - If there''s a more appropriate
place for me to ask these questions I''d appreciate being set straight.
I''m having a couple of misunderstandings/isssues first with page numbers
and secondly with auto-wrapping of simple_table.
First
pdf.start_page_numbering(pdf.margin_x_middle,
pdf.absolute_bottom_margin, 9,
2008 Apr 03
3
Branchable migrations -- A plugin to let you organize your migrations
I just put a new plugin named branchable_migrations on Github.
Branchable migrations lets you separate your migrations into
"branches" (i.e., a director under db/migrate) that each have their
own version. Using the forthcoming UTC timestamped migrations and
this plugin, you can separate migrations by table or feature. Doing
so should alleviate many of the problems that seem to pike up
2006 Aug 15
5
Hard time understanding the differences between "def self.foo" and "def foo"
Hi guys,
I''m having a little trouble understanding the differences and knowing
when to use "def foo" and "def self.foo" in my models. I don''t quite
understand them and was hoping someone could explain or give me
examples on how to use the "self." properly.
For example, I had "def foo" in my model "Account" and in one of
2007 Feb 07
11
Running patched rails
Hi,
Does anyone have any tips for running a patched version of rails? I am
currently running rails 1.2.2 and would like to keep up to date with any
future releases. I also want to run with the following patch:
http://dev.rubyonrails.org/ticket/5748
I am unsure how to manage this. Is this something SVN or rake can
handle?
Any tips/pointers would be very much appreciated.
Thanks,
GiantCranes
2006 May 05
8
pdf/writer: table.render_on best practices?
Hi All,
I generate a pdf report that contains a table. The report is 14 pages, and
it takes 20s to be rendered. Most of these 20s are spend in the render_on
method. I wonder if it is possible to speed up that process?
To create the report, I do the following:
1) Setup pdf layout:
# Setup pdf layout
pdf.select_font("Helvetica", { :encoding => "WinAnsiEncoding"})
2006 Jan 02
3
Pdf::Writer and #image
Greetings all - happy new year,
I''m having problems getting Pdf::Writer image insertion.
pdf.image "/path/to/images/logo.jpg"
is firing "JPEG marker not found!"
Originally created the RGB (8 bit) JPEG in photoshop. After the above,
I''ve exported with an alternate tool using (OSX) preview.
This tutorial
2006 Jan 15
13
Hotlinking an entire row in an HTML table
Hi,
This seems simple but I cant get it to work... I have a table with
4 or 5 columns and 20-30 rows. I''d like to have the ability to click
anywhere in a particular row to fire an action, such as bringing up
a "Details" page for the clicked row. This would eliminate the need
to generate a "Details" link at the end of every row, which is what I
have now and looks