I have a model object which did not have a counter cache on it before and I added it via a migration. The thing is, I tried and failed to set the starting value of the counter cache based on the number of child objects I already had in the migration. Any attempt to update the cache value did not get written to the database. I even tried ...
I am a RoR newbie. I tried a lot of things, finally came to following:
<td>
<%= Date.strptime(request.baseline_start_date, "%Y-%M-%D %H:%M:%S %Z").strftime("%M/%D/%Y")%>
</td>
But this is also giving me an error:
$_ value need to be String (nil given)
But I know that request.baseline_start_date gives me value (tried printing it se...
I am currently in the process of learning Ruby on Rails. I have been following the Learning Rails podcast and screencasts.
I've run into a problem, well more of an annoyance. Every time the screencast has me kill the mongrel server I am forced to close the console window because CTRL+C isnt killing it as it should. I then have to open ...
I have a BackgrounDRb worker set up to run its 'sync' method every 15 minutes. Then, say, I want to run the method once just now. I was trying to wrap that in a rake task as follows:
namespace :mytasks do
task :sync do |t|
worker = MiddleMan.worker(:my_worker)
worker.async_sync
end
end
But this doesn't work. It bails out w...
I'm currently looking at a hefty Rails test suite. It's nothing I can get into specifics about, but the run time for the entire suite (unit/functional/some integration) can run upward of 5 minutes.
We're completely reliant on fixtures and are we're not mocking and stubbing as much as we should be.
Our next few sprints are going to be ...
Which one to use for process monitoring and why?
...
I'm curious how to solve this in a clean way. I've read a few forum posts but couldn't do something that works.
I have a dropdown which — on change — should change a value for a remote_function. The remote_function only needs to be called when the propriate radio button is enabled.
select: download <-- should affect rjs call to get a...
I have developed a simple library in Ruby and need to use this in several Rails applications (some of which are not built yet). What is the best way to easily add this Ruby library to several Rails applications as and when required? Our team is running Ubuntu and our repository is Mercurial.
Should I use a...
Rails plugin? This would ...
Does anybody know any Ruby on Rails time_select plugins that have only one select box? So the select box has entries like "9:00 AM", "9:15 AM", etc.?
I have seen a few plugins, but nothing like this.
Thanks!
...
Hey all, hope you guys can help; I've followed about every tutorial on the net with no luck.
I've just moved over to Ubuntu 8.10 as my dev box; it's my first serious foray into Linux as a daily-use OS, and I'm having a hard time getting Rails going. I have followed a number of tutorials which all seem to work fine, but when I try and u...
I'm having a problem coming up with a query that would work for these models. I have three models that are connected.
An Organization has many Users, and Users have many StatusEntries
Basically this means I could do
Organization.find(1).users.find(1).status_entries
And have a list of status_entries returned to me.
The problem is I ...
Hi,
I have a very strange issue. I upgraded my Application to Rails 2.3.2 without any problems, then freezed it to vendor/rails and worked through all my specs after I also upgraded Rspec to 1.2.4. At some point (I cannot exactly tell you when) nested parameters didn't work anymore.
That means the server receives something like:
{ "po...
I am currently developing a rails application that tries to copy/move videos from one bucket to another in s3. However i keep getting a proxy error 502 on my rails application. In the mongrel log it says "failed to allocate memory." Once this error occurs the application dies and we must restart is.
...
I want to start experimenting with all these different web frameworks that are available. I was wondering if they could all run in one machine at the same time?
I know that all my database services can all run at the same time, along with the Javascript frameworks, but what about something like Rails and Java applications? Can those pl...
I've got the following models:
In plan.rb
has_many :tickets
and in ticket.rb
belongs_to :plan
validates_presence_of :plan_id
When executing the following code in the controller
@plan.tickets.build( ... )
@plan.save
save fails with error_message for ticket: plan can't be blank. (plan is valid.)
...
Note This originally started as a question about 404 errors, but now it's a question why the patch that I applied would make a difference.
How do you get a cached action to return a 404 on all requests that raise an ActiveRecord::RecordNotFound exception, not just the first request?
For example, if you start an empty rails project, add...
I have looked at the following, but they aren't clear, particularly the reference to DataMapper and gem dependencies.
all I want as an outcome is to be able to take my @user.email value that is in a |do| loop and display a gravatar where identicon is set to "y" -- in other words, those cute seemingly random drawings!
But when I look at...
I have a Vendor controller for show:
def show
@vendor = Vendor.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @vendor }
end
end
In my View for Reviews (where Vendor :has_many Reviews)
<% if @vendor.reviews.empty? %>
No Analyst Reports yet
<% else %>
<% for review in @vendo...
Hi, I currently have the following for-loop. This is in the 'view/vendor/show.html'.
I set up a 'vendor :has_many :reviews' and this is the for-loop:
<% for review in @vendor.reviews %>
<%= review.user_id %>
<%= review.summary %><br />
<%= link_to 'More', @review%>
<hr class="left span-5" />
<% end %>
For the link_to I would...