Displaying 16 results from an estimated 16 matches for "olsonhttp".
Did you mean:
alsohttp
2007 May 05
3
DB trigger vs before_create
Hello everyone,
I''m having trouble figuring out which approach is better.
I have the following tables: products, orders and line_items.
Every time an Order is placed, the quantity field in the products
table has to be updated for each LineItem in the Order. One option is
to use DB triggers which is not as portable as using before_create in
the Order model. But with before_create I cannot
2007 May 14
6
ActiveResource and RESful edit
Hi
I''d like to know how to have ActiveResource generate a URL for the
/teams/1/edit
type of resource.
I''ve got custom_methods.rb and have used
Team.find(1).get(:edit)
This generates
http://localhost:xxxx/teams/1/edit.xml
But all I get returned is a hash of the attributes (in this case of
team 1), rather than an object of team 1.
In other words the
2007 May 04
5
Something wierd with .save method
Hi,
I have a very sime app.
I need to create as many records in the db as the selected
checkboxes (named :isselected) in the view.
Here is the code snippet from the controller:
isselectedhash = params[:isselected]
for mod in isselectedhash.keys
@issue = Issue.new(params[:issue])
@issue.state = ''NEW''
@issue.mod_id = isselectedhash[mod] # this gets
2007 Sep 09
4
Images larger than 40k uploaded with attachment_fu won't display
I have a problem displaying images when using attachment_fu. When I
try to display the image, only about 40k appears in the browser, and
with some images even that much is not visible (just garbage when I
view source). I can display images smaller than 40k correctly.
I''m storing the images in the database (mysql) and haven''t tried
storing in the file system to see if that works
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by
default? I know I can use tag!, but I''d like to find a way for it to
translate underscores to dashes automatically. In other words:
xml.department_manager do
"fred
end
#=> <department-manager>fred</department-manager>
I tried hacking Builder::XmlBase.method_missing but got myself all
twisted up!
2007 Jan 25
2
render .rhtmlx if present, otherwise render .rhtml
We have a product where our customer is "allowed" to make minor changes
to the .rhtml views.
Obviously, this can be an issue when updating the software, as changes
need to be merged in. Also, sometimes the customer wants to back out
there change but no longer has the original file.
SOOO....
I''d like to tell them
- if you want to change a .rhtml file
- just copy it to
2008 Mar 14
3
ActionController <-> ActiveView code access ambiguity
Hi All!
This is not a problem in general but i''ve just missed the point.
If my application has a global state, which i have to use both
throughout ActionController and ActiveView, then, where to place that
state?
E.g. if I do this:
class ApplicationController < ActionController::Base
protected
def authenticated?
!user.nil?
end
end
then I can''t use that from any
2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb:
map.resources :product_categories
it provides urls such as:
/product_categories
/product_categories/1
/product_categories/1;edit
etc.
and uses the ProductCategories controller.
how can I keep the same controller (and model) but set up the resources
so that I can have any abitrary url point to the existing controller,
much like specifying the controller
2007 Mar 10
6
ActiveResources 0.1.0 Released
See the blog post at http://blog.lonestarsoftware.net/2007/03/09/active_resources-010-released/
Reading through the rails blogosphere last week, I read a post (which
I can not find again) that suggested a completely different approach
to AJAX use in rails apps. The idea was to create a Javascript proxy
to the ActiveRecord models and allow AR operations to be called from
the client.
I see this
2007 Feb 01
12
RESTful Rails and other musings
Hi all,
I would first like to introduce myself to the Ruby on Rails (RoR)
community and to say that I hope to begin to build some relationships
with other RoR developers.
I''m a long time Java programmer (5+ years). Java was my first
experience with Object Oriented Programming (OOP). Before Java I
developed using many other languages including C, Pascal, Fortran,
BASIC, Visual Basic,
2007 Nov 08
5
Rails byte-range request support
Hi,
I''m trying to serve the iPhone a video file from my controller using
send_file. However, it appears as thought the iPhone requires byte-
range request support and rails doesn''t seem to support this.
If I give the iPhone a url that points to an actual file (i.e. it''s
served by my webserver nginx, instead of rails) it downloads and plays
it fine.
Here is the proof
2008 Mar 19
7
Upgrade to 2.0.2: InvalidAuthenticityToken error on 1st POST
All,
I''ve upgraded to 2.0.2, and I can''t get my login screen (the first POST
request in the application) to work.
When I post this form, I see the "InvalidAuthenticityToken" error.
I have
protect_from_forgery :secret => ''my_secret''
set in application.rb
and I am using an active_record session store based on this line in
environment.rb:
2007 Dec 30
6
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded
today) and upon running the generator, doing the migration, prepping
the test system and putting the resources in routes.rb I get a Rspec
test failure:
''SessionsController logins and redirects'' FAILED
expected not nil, got nil
routes.rb has:
map.resources :users
map.resources :sessions
nothing else was
2007 May 23
8
ImageScience, Mini-Magick and RMagick
I''m going to be generating thumbnails from user uploaded images. I''m
looking around at the libraries available to do this sort of thing and
there are three that look promising.
ImageScience -- http://seattlerb.rubyforge.org/ImageScience.html
Mini-Magick -- http://rubyforge.org/projects/mini-magick/
RMagick -- http://rmagick.rubyforge.org/
It looks like a lot of people are
2007 Jul 24
9
will_paginate plugin doesn't work with Association Extensions?
I have:
class Post < ActiveRecord::Base
has_many :comments do
def published
find( :all,
:conditions => {:published => true} )
end
end
end
When in my controller I do
Post.find(:first).comments.published.paginate :page => params[:page]
I get an error
undefined method `paginate'' for []:Array
Is will_paginate supposed to
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