I have a problem, I'll simplify it down to the blog example.
1) Each 'post' is created by a different user stored in a 'User' database.
2) Several 'comments' belong to the one 'post'.
3) When a new 'comment' is made, the user who created the initial 'post' needs to be emailed.
I have setup the mailer and observer. I am just not sure how...
Hi,
I programmed in Ruby and Rails for quite a long time, and then I fell in love with the simplicity of the Sinatra framework which allowed me to build one page web applications. Is there a web framework like Sinatra available for Erlang? I tried Erlyweb but it seems far too heavyweight
...
Hi all
s it posible to align an image to the right and wrap text around the image like it is in html and css using the float:right property ?
If so how do you do this ?
I can align an image but dont't know how to wrap the text around it. The text is dynamic text therefore varies alot in length.
Thanks alot
Rick
...
I have a model that has an overriden to_param method returning the (unique) name of a record. This works quite fine, however with one caveat - the user can edit the name.
If I have record #1 with name="abc" and record #2 with name="xyz", then a user editing record #2 and changing name to "abc" will get an error upon saving as the valida...
hi
i have some conditions to pass to a finder. The problem is that i don't want to pass in an usafety way. So imagine that i receive a hash:
hash = {:start_date=>'2009-11-01',:end_date=>'2010-01-23'}
i would like to pass it to my finder like:
Model.find(:all,:conditions=>"created > '#{start_date}' and created < '#{end_date}'")
The...
I've come across a frustrating issue with FastCGI and Rails whereby lighttpd is treating routed url's as static files (i.e. not sending them to rails since it believes they're static)
If I hit the root path I get the rails application, but as soon as I hit something with a URL structure, even a path that matches the default :controller/...
Hi folks,
I am stuck one more time ... and one more time I suspect it's a stupid syntax problem:
I want to pass 2 vaiables in the url with my super simple search form.
I was expecting a URL like this:
http://mydomain/categories/search?search=pdf&os=2
But I get this:
http://mydomain/categories/search?search=pdf&os[]=
I though...
Here's my situation - I have a helper named LayoutHelper that I use to help me build my layout, and I'm trying to test the following method.
It has a method in LayoutHelper that looks similar to this:
def show_login_form?
return false if @hide_login_form || logged_in?
return true
end
I also have the following in my application.rb...
If a gem has rails dependencies, do you think it is better to write the gem tests in a way they can be run standalone or run them under a rails project?
...
I have a rails app that loads lots of data from some java services. I'm writing a module that will allow me to populate some select boxes with this data and I'm trying to include these properly so I can reference them in my views. Here's my module
module FilterOptions
module Select
def some_select
return "some information"...
Hi All,
I have a table with a column called lifecycle_id, and another called lifecycle_change_reason. lifeycle_id is normally changed automatically by the system based on other factors, but certain users have the ability to change the lifecycle manually. if they do, I would like to require them to provide a reason for the change, but I...
I am building a REST Web Service layer on top of a Rails app that will be used by an Iphone application. The response format is XML.
I would like to build some acceptance tests that should be external to the rails stack (and should test everything, including the http server). The test scenarios are quite complex, involving the process ...
We have written a Ruby on Rails application that allows a visitor to fill out a form with personal information (name, address & other confidential details), which is stored in a database until the information can be collected by a batch process running inside institution's firewall.
To prevent attackers from getting this confidential in...
I am a rails rookie and fear that my question is woefully ignorant - please be gentle.
I am building an app that will catalog and monitor other websites, and need to synchronize with an external data source (thus overiding primary key).
I have the model below, but i cannot figure out the routing for accessing individual records (tho li...
Suppose you're in your users controller and you want to get a json response for a show request, it'd be nice if you could create a file in your views/users/ dir, named show.json and after your users#show action is completed, it renders the file.
Currently you need to do something along the lines of:
def show
@user = User.find( params...
I was working on my Rails project which is checked into Git. I read tutorials and they said for everytime you start to change something, check out a branch.
However, accidently I made some changes but did not check out a branch.
What should I do now?
What commands can I run so that Git takes my new changes and push them on my reposit...
I am interested in making a 3D pie chart dynamically on my page depending on values pulled from my database. The chart would only be updated every few days, so I don't mind a process intensive task as I could cache the image. 2D charts and pie graph libraries seem to be everywhere, but are there any libraries (server side image magic, or...
I have nested routes like this :
map.resources :foo do |foo|
foo.resources :bar do |bar|
bar.resources :baz
end
end
i have list with pagination in the index action for each resource, i need to caches each of this pages, to do so i need the routes to be RESTful, how do i implements REFTful routes for it?
for example i want the...
How do you make a generator that alters a file.
Im trying to make it so that it finds a pattern in a file and adds come content to the line below it.
...
What's the best way to send quick one-liner e-mails to an administrative address in Rails?
I am using the Rails Logger to keep track of nasty problems in my application. One of my controllers is doing mission-critical work and I need to know of any errors ASAP. When there is an error, I would like my app to send an email to myself, ca...