The problem:
I have a collection of people, I want to have a revise.html page that allows me to increment a integer on all the people.
if I make a new method in the people_controller it auto sends me to people/revise.. which gets interpreted as show/revise... which is not an id.
I understand this happens because of REST constrictions....
I have a form created using HAML, that is submitted via:
$('appt_form').request({
onComplete: function(){
...
}
})
And for testing I have the controller simply returning:
render :json => {:name => "Ted"}.to_json
But that causes the browser to launch a dialog that has the options to 'Open with...' or 'Save As...'.
...
I have a stream of activities (Activity) belonging to users and with a created_at. I'd like to present a stream of the 10 latest activities, with the caveat that I want to group activities together. I know I can use group_by, but I don't want to group everything together by user, only those activities that appear > 2 times consecutivel...
I want use on my rails helper a script as follow:
select_tag(:article_id, option_groups_from_collection_for_select( @article, :categories, :name, :id, :name, :include_blank => "Select one category"))
but in my script, nothing happens. How can I use option_groups_from_colletion_for_select with include_blank method?
...
Cause I have a custom styled / positioned button.
Currently, our set up is:
Special upload button (Fancy)
Hide the file_field in a div, cause the button can't be moved to be separate from the text.
But we still want the text saying what file you've selected
...
I'm getting Rails and Cucumber going on my Mac OS X box. When I try to run the following scenario:
Feature: ActorDetail
In order to learn about an actor
As a costumer
I want to see their details
Scenario: Actors page should exist
Given I am on actor page
Then I should see "Actors"
When I attempt to run the tests I get the foll...
Hi all. I'm very new to rails and attempting to deploy some changes to my production server. In particular, I froze up my gems and have them all ready to go in my vendor/gems/ directory. I have also updated my config/environment.rb file to reflect the proper :lib and :source. When I try to push my content to my production server (via a S...
Hello,
I have a made a news aggregator Newzupp which I want to modify. Right now I am simply displaying the titles of the news stories and I am linking them to their urls.
I am planning to make it more graphical, by using images + titles instead of plain titles. I want to know how can I get the main image of each article (somewhat si...
when a user created a new account on my site, id like to load sample data into his account. I would have done this easily with fixtures but the problem is, the sample data needs to know the new account id, so i need to pass this to the fixtures, but i don't know if its possible.
That's my idea, but I am open to other best way to load sa...
My boss wants me to develop an application very similar to an accounting system (that will be a part of another big system, written in ruby (using rails) and javascript (using extjs))
How can I start?
For example, I had a plan to use mongodb for our system, but now I'm not sure because of luck of transactions and ACID in mongodb.
Wh...
Hi guys!
So after a couple of months of development today I am finaly deploying!
(WOOHOO great day).
But i am stuck with a problem I can't seem to fix:
First of all in development all is working perfectly.
In deployment on my server it isn't though!. I use attachment_fu and i
am able to upload
pictures but the pictures are not resizing...
I'm trying to recalculate percentages in an after_update callback of my model.
def update_percentages
if self.likes_changed? or self.dislikes_changed?
total = self.likes + self.dislikes
self.likes_percent = (self.likes / total) * 100
self.dislikes_percent = (self.dislikes / total) * 100
self.save
end
...
Hello I'm learning Rails3 so I start to use gem Bundler (http://github.com/carlhuda/bundler)
Does anybody know, how to setup TextMate to highlight Gemfile syntax?
Thanks!
...
Hi everyone (:
I want to use delayed_job to send email in backend, this is
/config/initializers/setup_mail.rb
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => DOMAIN,
:user_name => USERNAME,
:password ...
I plan to develop web site in PHP using MYSQL ...which applications call for the use of technologies like Ruby-on-Rails , AJAX and Coldfusion. Thx.
...
Hi there
I've just started with Rails (having previously worked in Django). The hardest part is working out how to use haml.
I have found the official haml documentation. However, there seems to be no coverage here of syntax - if/else clauses, for loops, etc.
Other than Googling for examples, is there any official documentation of sy...
I use example with Rails 3, but I believe that this is true for Rails 2.3 as well.
Suppose, I have model City that has many Locations. I try to find Cities that have locations.
I use following code:
City.joins(:locations)
But output array is:
=> [#<City id: 5, name: "moscow", created_at: "2010-07-02 15:09:16", updated_at: "2010-07-...
I have a destroy action defined for a particular resource. On completion, it uses an rjs file with a visual effect to remove the resource from the page that it is being called from.
My problem is that the destroy action can be called from 2 different templates. And so the visual effect needs to be different, depending on which template ...
In haml, how do I render the following incredibly basic HTML:
<p>Results found for <strong>search term</strong>
where 'search term' is actually a Ruby variable called @query?
I'm trying the following,
%p results found for <strong>= @query</strong>
But that renders = @query literally. If I try:
%p results found for <strong>
= @qu...
As shown in a blog I followed the instructions of setting up SQLite3 on my Windows, but after I pasted the necessary files in Bin folder of Ruby, which I downloaded from http://www.sqlite.org/download.html, I get the following error when I use the following commmands:
C:\gem install sqlite3-ruby --version=1.2.3
ERROR: http://rubygems....