Displaying 20 results from an estimated 20000 matches similar to: "routing requirements broken in Rails 1.1.4?"
2006 Jul 07
5
Can a route require POST or GET? / REST problem with routing
Hi,
A store front a customer wants to GET /product/5/show. But for the
application this is really GET /cart_item/new/5 or even better
/cart_item/new?cart_item[product_id]=5
When the customer clicks add_to_cart they POST /product/5/show so that
the url doesn''t confuse the user when any validation errors occur. But
for the applicaiton this should be POST
2006 Apr 07
6
Multiple view types for a single action?
Is it possible to have more than one kind of view for a specific action,
for example an .rhtml and a .rjs file to handle the view for the same
action?
I suspect not, but this makes me wonder if there a way to call the .rjs
file from within the .rhtml so the statements within it get executed?
Thanks,
Andy
2006 Apr 08
5
What is the h for?
In the "Agile Web Development with Rails" book it runs through making an
example application, a shopping cart.
In one of the views files, there is one line of code I dont understand
(below), I dont know what the "h" is for, also I took the h out, and it
did not affect the application (as far as i could see).
<%= h(product.title) %>
Can anyone shed some light on this
2006 Jul 18
16
Session is being shared between tabs!!??
I have just spotted quite a serious problem with my rails app. My app
uses the session to store information. Most people who use the app may
have more than one instance of it open in their browser (multiple tabs).
The session stores which country the user has selected. On each browser
tab the user may select a different country. You can add items to a
country. There are problems with
2006 May 19
5
How to determine if an object has just been created
Is there a built-in way to determine if a model object has just been
created (ie. this object was the one that was originally persisted)? I
can''t see it anywhere in the AR code, but thought I''d check. I want
something like:
p = Person.create
p.original_instance? # true
Is this built-in or should I just patch AR?
-Jonathan.
2009 Dec 07
1
routing requirements quick question
Hi everyone, first e-mail here :)
I have the following in my routes.rb file.
map.connect ''posts/index/:page'',
:controller => ''posts'',
:action => ''index'',
:requirements => {:page => /\d+/ },
:page => nil
end
Does :requirements => {:page => /\d+/ } mean that if the :page
2006 May 05
2
how to get image properties
Hi friends
in PHP there is a direct function GetImageSize(), with it I can easily
determine the dimentions of an image file.
How can I do in RoR.
Please help me out
Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060505/13ba1640/attachment.html
2010 Feb 26
2
Fwd: how to install rmagick on fedora please help urgent
hi all
i want to run project at local system ..see this i m getting some error
http://pastie.org/843746 and when i run server http://pastie.org/843748 plz
tell me how to install rmagick on fedora
Regards,
Shyam
+91-9716-18-9650
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2009 Feb 24
7
Add .html extension by default
Hi all,
i would like to add the .html extension by default to all my
resources. What is the best way to do that? The reason for this is
that i need to download the generated sites via wget and i need
the .html extension for the downloaded files. Also it would be nice if
the link_to would automatically generate the links with .html...
Thanks,
Gerold
2007 Sep 18
10
Routes
hi all,
I want to move some routing tasks out of the router and into the
controller. The goal is to make Merb feel less like mod_rewrite and
give the user more control at the controller. The new Router is
simple: it takes the path_info (not the whole request) then outputs a
controller class and some parameters from the path matching. The rest
of the routing would be done at the controller level.
2006 Jul 24
2
Flash problem with RoR? missed something?
I have tried to put a flash movie inside of my RoR page and it shows up
with nothing on IEPC.
It does very well on every other type of browser but does not work with
IEPC.
I made a folder - "flash" in my public directory and have had the one
instance of it point there.
Thus my flash directory is www.rails-app.com/flash/flash.swf
Is there anything that anyone knows to help out?
2006 May 23
2
Ordinalizing a date
I''m trying to use the ordinalize() method to ordinalize a day. Here''s
how far I''ve gotten:
@reportday = Time.now.at_beginning_of_week.strftime("%d").to_i
@ordinalized_reportday = "#{@reportday}".ordinalize
I was thinking it wasn''t working because the date is being returned as a
string, however I added the .to_i and still it returns an
2006 Apr 07
4
How to generate mapping with migration
Hi there, I''ve tried to add a m:n mapping table using the migration
mechanism.
ruby script\generate migration add_categories_notes_mapping
and filled the migration file with:
class AddNotesCategoriesMapping < ActiveRecord::Migration
def self.up
create_table :categories_notes do |t|
t.column :category_id, :integer, :null=>false
t.column :note_id, :integer,
2007 Mar 21
6
Converting Rails app to desktop with XUL?
Hi,
We are thinking about choosing Rails as our weapon of choice for our
next project, which is basically a text editor on steroids, whith some
functionality that need an Internet connection.
In the first step we are going to develop it as a plain web app
(AJAX-ified, yay!), however, in the next step we would like to port some
of the functionality (such as the editor) to a desktop app (which can
2008 Jan 31
3
Handling multiple Check boxes in a XHTML Strict way
Hi,
The default way we handle an array of checkboxes is like this:
<% items.each do |item| %>
<%= check_box_tag ''item[]'', "#{item.id}" %>
<% end -%>
this returns an array item[] that holds the ids of all the items.
Now the real issue:
1. The above loop will same ids to ''n'' items
2. All ids will be ''item[]''
2007 Feb 28
6
DRY question - image_tag :alt and :title the same
Hello,
I have the following:
image_tag(''show.png'', :alt => ''show article'', :title => ''show
article'', :border => 0)
Is it possible that I donĀ“t need to have "=> ''show article''" twice in
this row? e.g. something similar to this pseudo code: (:alt, :title)
=> ''show article''.
2006 Apr 05
7
select_tag - populating options
Hello,
I want to a select tag, where you can choose a number between 1 and 100.
My inital code is based on the examples from Agile Web Development with
Rails, and looks like this:
view:
<%= options = [["Select number of lines", ""]] + RfqLines::LINE_QTY
select("rfq_line", "line_qty", options) %>
model:
LINE_QTY = select_fill
def
2006 May 03
6
sql server, date and time
Hey there all,
Is there some way to tell rails or sql server to ignore the time in a
datetime field when doing a comparison?
For example, if I do something like
select * from users where registration_date = ?, @date
where @date might equal some user input like ''03/14/2006''
The result is nothing returned, because in my tables the datetime
field looks like this:
3/14/2006
2006 May 16
10
Date verus Time class
I''m using the date_select and datetime_select helpers in my view, and
they return Date classes from the params hash.
But how do I work with Date classes, they don''t print human readable
dates or times, Time classes work well I can use strftime("%H:%M") to
print to the screen.
Is it possible to convert a Date to a Time, Ive been tinkering in irb
but have got
2006 Jun 07
3
#5209 patch: :dependent => :nullify deletes child records
Hi everyone,
A couple of weeks ago I noticed a bug with :dependent => :nullify on
a has_many or has_one. When you delete the parent, the children''s
foreign keys are nullified, as expected. But when you do
parent.child.delete or parent.children.clear, ActiveRecord actually
deletes the child records, rather than just nullifying them.
In my eyes, if you''ve set