Is there any data regarding how browsers actually support rest http verbs (especially PUT, DELETE). This question is mostly motivated by the fact that many sources (such as this stackoverflow answer) inform that most browsers don't suport PUT and DELETE but don't say which.
Rails solves this using a patch on the client, and reversing th...
I have several very good books like "The Rails Way", "Learning Rails", etc., those which are written for Rails 2.1 or Rails 2.2 But the latest version I am using in my machine for my projects is 2.3.8
I dont want to miss the content in that book. I want to keep multiple versions of rails in my machine and choose the version when I creat...
Is it possible to use ruby code in RJS files?
For example, the destroy.js.rjs file
if @template == "viewer"
page["viewing_registry_#{@viewer_registry.id}"].replace_html :partial => "shared/request_viewer_link"
else
page["viewer_#{@viewer.id}"].visual_effect :DropOut, :duration => 2.0
flash.discard
end
This is the RJS file call...
I want to upload any audio file and want the out put in the mp3 formate . Is it possible in rails ? Is there ffmpeg code or any thing that convert any audio file to mp3? if any share
...
Hello!
I have a big problem (even my server's admin seems to have some difficulties to solve it).
I used my cpanel (11.25.0-STABLE) to create a new ruby on rails application, which work fine when accessed to its original uri (with port number).
To make that uri more "user friendly", I have created a rewrite to access my RoR applicatio...
I'm writing a web site with rails, which can let visitors inputing some domains and check if they had been regiestered.
When user clicked "Submit" button, my web site will try to post some data to another web site, and read the result back. But that website is slow for me, each request need 2 or 3 seconds. So I'm worried about the perfo...
I have an online portfolio created in Rails featuring different projects. I want to be able to filter the projects by keywords. My approach is to define a method for each keyword in the ProjectsController and link the keywords to call the methods.
For Example Keyword = graphic_design:
<%= link_to 'Graphic Design', :action => "filter_...
I have a user table, and a teacher that I newly created. The teacher is sub class of user, so, I use scaffold generator to generate the teacher table, than, I modify the model to do teacher is subclass of user. After all that, I did a db:migrate. Then, I go to
http://localhost:3000/teachers/new
It shows an error:
undefined method `te...
Hi.
I am using Cucumber as the BDD framework with rspec/mocha mocking. Ideally we would not mock/stub behavior in cucumber specs; however the scenario is exceptional here. To give you the brief idea of problem here; I have two features product feature and cart feature.
Cart feature is currently mocking some of the product fetch from 3 ...
I'm building a web site with Rails, which will do something in the background. I don't want to use DelayedJob, because it needs a database.
What I wan't to do is simple: get some data from another site, save the response in the memory, and keep it for 10 minutes.
Is there any tools can do this?
...
I have Rails polymorphic model and I want to apply different validations according to associated class.
...
I am totally new to javascript and am probably biting of more than I can chew, but I am trying to get the jQuery autcomplete widget working on my Rails site.
I have a page called "links" where I want to be able to assign a person to a link. Using the autocomplete I should be able to have a textbox that drops down a list of peoples names...
I have something like this:
class Employee < ActiveRecord::Base
has_one :office
end
class Office < ActiveRecord::Base
belongs_to :employee # foreign key - employee_id
end
If I want to edit the employee, at this form what can I fo to edit the office data?
<% form_for(@employee) do |f| %>
<%= f.error_messages %>
...
I have a Rails application running on Rails 2.3.9. It runs fine with ruby 1.8.7. I'm testing it with ruby 1.9.2-head right now.
The application loads fine until I try to load a page that relies on a unicode string. Then I get the infamous encoding error:
ActionView::TemplateError (incompatible character encodings: UTF-8 and ASCII-8BIT...
How do I tell Paperclip not to save the original file when it is uploaded? Or even better, to store a scaled version of the file as the original?
...
I have a Picture model in my app that uses Paperclip to attach an image to it.
The model:
class Picture < ActiveRecord::Base
has_attached_file :image, :default_url => "/system/:attachment/missing.png", :styles => { :small => "100x100#", :medium => "460x460>", :large => "1024x1024>" }
validates_attachment_presence :image
validate...
rake cucumber --trace
output:
/usr/bin/ruby1.8 -I "/home/vadim/.bundle/ruby/1.8/gems/cucumber-0.8.3/lib:lib" "/home/vadim/.bundle/ruby/1.8/gems/cucumber-0.8.3/bin/cucumber" --profile default
Using the default profile...
...
Given I signed up with "username/[email protected]/password" # features/step_definitions/clearance_steps.rb:13
...
I am a new guy in Ruby, and I have tables with these primary keys:
transaction_types:
transaction_type
transaction_headers:
transaction_type
transaction_year
transaction_id
transaction_details:
transaction_type
transaction_year
transaction_id
city_id
ticker_id
tickers:
city_id
ticker_id
Of course, those models have other non ...
First let me explain that I've created a million lib directories scouring out all the different responses to this same problem but none of them have really done the trick..
I've tried
sudo mkdir /opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-3.0.0.beta4/lib
sudo mkdir /opt/local/lib/ruby1.9/gems/1.9/gems/rails-3.0.0.beta4/lib
sudo mkdir ...
I'm allowing users to create a 'Question' from different pages in the app, and want them to be redirected to the right page after the new question is saved. Since one page has a params[:id] and one doesn't, I thought I'd use that to differentiate between the different redirects.
Here's what I was trying to do in my Questions controller:...