Displaying 20 results from an estimated 20000 matches similar to: "Print action to send body content to pdf-writer , which stra"
2007 May 10
13
REST own action
I can sent my own action to a users_controller stating in routes.rb
map.resources :users, :member => { :network => get }
I defined in my users_controller the network action....
so I can have an url like
"http://localhost:3000/users/168.xml;network"
now I would like to have another action network_plus which is a little
bit different fron the network..
sure, I can state another
2007 Sep 08
1
Unknown Action doesn't raise exception ?
As I am in development environment, I wrote in my config/environment.rb
ActionController::Base.consider_all_requests_local = false
in my application.rb, I wrote
def rescue_action_in_public(exception)
case exception
when RoutingError, UnknownAction
render :file => "#{RAILS_ROOT}/public/404.html", :status =>
404
else
logger.error
2007 Jul 02
3
stupid Rails rendering
I dont'' understand why it''s not possible to have a conditional
redirection in rendering
respond_to do |format|
format.js {
render :update do |page|
page.redirect_to posts_url if @located
page.replace_html ''error_message'', "Error..."
page << "$(''popup_error'').popup.show();"
2006 Oct 14
2
sending parameters with link_to_remote Ajax Request
In a panel, I have an hidden input field which is modified by a
javascript function (from calendar)
how can I sent the value of this input field in my link_to_remote call ?
presently I just send back one parameter (an id) but I need both...
<input type="hidden" name="booking[start_at]" id="f_date_s"
value="booking[start_at]" />
...
<%=
2006 Aug 01
0
SEARCHING w JOIN in one-to-ma,y relationship
I am doing a Search in my ''properties'' table on column ''name'' using in
my controller :
conditions = ["name LIKE ?", "%#{@params[:query]}%"] unless
@params[:query].nil?
this ''properties'' table has a FK (owner_id) in teh column ''owner'' to
link it with the table Users...
I can display the owner.name, and
2007 Jun 26
3
what is the :or parameter in a submit_tag ?
I read the following tag in teh Beast example
<%= submit_tag''Login'', :or => link_to_function(''forgotten password'',
"$(''reset-password'').toggle();") %>
I understand the link_to_function, but what is this :or parameter used
for ?
the link doesn''t appear, so it cannot be used...
thanks for your lights
kad
--
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,
2006 Aug 09
5
Action Mailer ...mail done but not received.. (or sent ?)
I am using Action Mailer as stated in RoR book... the mail seems to be
correctly setup..
and I get the following log..
Sent mail:
Date: Wed, 9 Aug 2006 19:54:04 +0200
From: support@alemat.com
To: myself@mac.com
Subject: Your password is ...
Mime-Version: 1.0
Content-Type: text/html; charset=utf-8
_____________
Your username is barbare. Your new password is tDRvfzNvDF. Please login
and change
2006 Jun 19
11
html to pdf?
in one of my apps i am currently using redcloth to use textile
formatting on my content.
i am wanting to add reporting to the system, but the content that prints
out doesn''t have the formatting obviously that i can have with html.
what''s a good solution for some kind of formatting where i can use it on
both web and print? i''m using pdf/writer right now and i think
2007 Jan 20
2
find_by_sql with named parameterized sql
I tried to use named parameters in my SQL query , using find_by_sql
Order.find_by_sql ([select * from orders where amount > ? and quantity >
?", [ @amount, @quantity ] works;..
but
Order.find_by_sql ([select * from orders where amount > :amount and
quantity > :quantity ", [ :amount => @amt, :quantity => @qty ] is not
working
a I wrong or should I use a plain select
2007 Jun 12
3
REST Routing issue
If I use http://0.0.0.0:3000/users/25/messages/new
I can create a new message ressource for user 25 that''s OK....
I would like to be able to use such url :
http://0.0.0.0:3000/users/25/messages;send?to=5
in order to create a new message from user 25 for a specific receiver
how should write my route ? I tried....
map.resources :users do |users|
users.resources :messages,
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from
class PostsController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, :with => :deny_access
...
def show
@post = Post.find_by_id(params[:id])
raise ActiveRecord::RecordNotFound if @post.nil? #illegal access
.....
end
def deny_access
respond_to do |format|
format.html
end
end
but the
2007 Jun 30
2
REST Route how to avoid hacking routes
what''s the best protection against someone trying to modify an URL in a
named route
/users/25/posts
if the user enter another URL /users/26/posts, he can get acces to user
26 posts unless ..
a before_filter is checking the current_user ID
but is there any other way to do it ?
thanks for your lights
kad
--
Posted via http://www.ruby-forum.com/.
2006 Oct 31
3
ActionMailer how to check mail sent
OS X 10.4.8
I am sending an email via Actionmailer
settings are written correctly in environment.rb
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.raise_delivery_errors = :true
ActionMailer::Base.perform_deliveries = :true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.server_settings = {
:address => "mail.mydomain.com",
:port => 25,
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 Aug 04
3
<img onclick> vs link_to_remote()
In one of my view , I have an image the user need to click to close a
<div>selections</div> added by an Ajax call.
if I use :
<img src ="/images/icon_closeitem.gif", size="16*16",
border="0",alt="Close Selection", title="Close", onclick="<%=
remote_function(:url => { :controller => ''property'',
2006 Jun 13
2
Top margin on PDF generated with PDF::Writer
Hi,
A little question. I''ve written a method that uses PDF::Writer to
generate a PDF document with some images and text. This is the code on
my controller:
def pdf
gen_pdf
redirect_to("#{@request.relative_url_root}/pdf/cupones.pdf")
end
private
def gen_pdf
pdf = PDF::Writer.new(:paper => "A4")
pdf.margins_cm(0)
pdf.start_columns(2, 0)
pdf.select_font
2006 Aug 13
1
select include_blank true
Is there any way to display a default message value ''Select'' rather tha
an empty value when using this option ?
kad
--
Posted via http://www.ruby-forum.com/.
2007 Jan 31
1
RJS collection proxy
I would like to update the class of all <a> tags found in a div of my
page..
I can get it all (seeing the index and value) using :
page.select("#header_domain_map a").each do |value, index|
page << ''alert(value);''
end
but how can I set the classof all these elements to class="active"
tfyl
kad
--
Posted via http://www.ruby-forum.com/.
2006 Oct 03
1
line too long in editor... (textmate)
my where :condition string line is too long in my editor, (Textmate...)
if I do a LR, I got a \n in my string, how can i get it displayed in
multilines without this garbage in the string :
here is the kind of string I am manipulating
cond_a.append ["(bookings.start_at == ? OR bookings.end_at == ? ) OR
(bookings.start_at <= ? AND bookings.end_at >= ? )",