Is it possible to completely remove rspec from a project, and then reinstall it again?
The reason I ask is because I had started my project on Rails 3 beta, and now that the new one has come out, the new rspec conflicts and nothing passes. But if I start a new project, everything seems to work as expected.
...
Right now, I'm in the middle of building a social media app on Ruby on Rails, i have implemented a 5 point voting system. Where you can vote the news posted on the site from 1-5, what I'd like to know is, What is the best approach at handling the updates on the voting system.
In example. If a user already voted in an article I'd like to...
I am on Ruby 1.8.6 and Rails 2.3.8. I am trying to install a older version of formtastic gem.
gem install formtastic -v 0.9.10
I got the following error:
ERROR: Error installing formtastic:
activemodel requires Ruby version >= 1.8.7.
I switched to Ruby 1.8.7 and tried to install the gem again. I got the following error:
E...
I have been developing Rails applications on windows platform for a couple of month now and I'm still looking for right tools how to do it more effectively.
I'm using Netbeans IDE and running all rails commands through windows CMD (including GIT). But NB feels kind a bloated and slow. I have tried using gVim but i did not have so much t...
I have a collection of partials being rendered using a layout for each element (wrapping in a container). However, when rendering the collection, an outer 'container' is also added (it appears to be adde to each render, despite no layout being specified.
Example:
# index.html.erb
<%= render :partial => 'sprockets' %>
# _sprockets.html...
This is an embarrassing noob question, but...
How do you do an OR query in Rails 3 ActiveRecord. All the examples I find just have AND queries.
Edit: without using a SQL string!
...
My form
<% form_for @search do |f| %>
<%= f.input :name_like_any %>
...
<% end %>
Controller
@search = Product.search
@search.name_like_any(params[:search][:name_like_any].split(/\s+/))
@products = search.all
This returns the correct result, but now my form shows the name as ["foo", "bar"] instead of what the user input ("foo b...
I read that prototype does but didn't know if that means scriptaculous does. I looked at the javascript folder and it had prototype, dragdrop, controls, effects, and application. Is that all scriptaculous? Do I just add a link to it in my layout to use it?
Also, The scriptaculous website said all sorts of "big names" use it, but I've...
I'm developing an app (basically an intranet) which has a few small sets of users, each a company using the app internally.
Up to now, each set of users has its own deployment with a separate domain name and database, but all living on the same server. This means that each time I have to push an upgrade I need to deploy once per client....
Hi,
I am trying to set a default value for a text field used for a search, which uses the observe method. Here's what I got which works.
<% form_tag('javascript:void(0)') do %>
<%= text_field_tag 'phrase', nil, {:onfocus => "$('results').show();", :onblur => "$('results').hide();"} %>
<%= observe_field :phrase,
:frequency...
I'm trying to use ObjectiveResource to make an iPhone app speaking to my Ruby site.
I can connect with log/pass, but I would like to have directly the account page on the first screen.
I retrieve the name like this : self.title = [ObjectiveResourceConfig getRemoteUser];
But unable to have all informations (always a nill object) when I t...
Wondering if I should ALWAYS use the respond_to/format.xxx block in ALL of my actions in ALL of my controllers. This came up because I realized that, for apps using only HTML response format (no respond_to block), I could send some other type of request (say XML) and get a valid response. Is this considered insecure? Feels to me like ...
Is it just a matter of installing the jquery.jq file in the javascript folder and linking to it?
...
I have two models (Item and Theme). They are both owned by a third model Users with a has_many association (User has many Themes and Items). Both Item and Theme have_many :images.
The Image model is a polymorphic association so the table has the columns imageable_id and imageable_type. If I had both an Item with ID 1 and a Theme with ...
the line
rails new someapp -m haml
doesn't work. It seems to need a path to some where.
Update: haml-rails is in fact installed by gem install haml-rails but the line above wouldn't work.
...
Up to Rails 2.3.8, there is a constant:
RAILS_GEM_VERSION "2.3.8"
but Rails 3.0.0 doesn't have it. Is there other ways?
...
Does the number of validation ClassMethods have anything to do with the performance of an application? Could a boatload of validations cause a strain?
...
Coming primarily from a .NET background, I am quite attached (for better or worse) to Visual Studio.
I'm going to school for software engineering now, though, and my first class is in XP (Extreme Programming) using Ruby on Rails. Mostly I've heard that when you're developing in Ruby, you tend to skip the whole IDE altogether; and I'm to...
I'm writing an app that will run scripts in a specified folder, and then record the numbers and graph them.
My problem is that if the script is a ruby file, the require statements fail inside the script because bundler seems to have done something funky with the load path.
Running rails runner Datasource.run_jobs fails:
class Datasou...
I want to use rake background task in rails like this
system("cd #{Rails.root} && RAILS_ENV=#{Rails.env} rake abc:def --trace 2>&1 >> #{Rails.root}/log/rake.log &")
This is ok in development environment, but will not work in production mode.
I used logger to check whether the command string is generated ok or not, but it seems every ...