I just installed cucumber, and I tested it. I got the following error:
teefcomp:cucumber-intro teef$ cucumber features/manage_users.feature
Using the default profile...
F----F
Failing Scenarios:
cucumber features/manage_users.feature:6 # Scenario: User List
1 scenario (1 failed)
4 steps (4 skipped)
0m0.029s
It seems to be suppressin...
I am trying to find a way to add content to a div that is defined in my application.html.haml file from individual view files. The reason I want to do this is because I have a sidebar that is always present and is defined in the template, but I would like to have content specific to each page included in the sidebar. Would this be done b...
I am new to RoR and I cant get one of my rotes to work, not sure whats going on? I have defined a route in my routes.rb file, somthing like this...
map.connect 'myurl/:someid/:start/:limit', :conditions => { :method => :get }, :controller => 'mycontroller', :action => 'get_data_list'
# method defintion in mycontroller
def get_data_lis...
Hi all,
I'm doing my best to create a site badge or widget for my site, which is a rails site.
Essentially it's a site where users post content that they've created and other who like that content can make a donation to express their appreciation for it.
I asked a similar question a while back about how to create a widget, but that wa...
I'm seeing code like this inside of an erb template:
<% hook :admin_footer_scripts do -%>
What exactly is hook? is it a standard method within ActionView?
...
Does anyone know if it's somehow possible to setup an alias for an ActiveRecord table join?
Something like:
User.find(:all, :alias => "Users as u", :joins => "Friends as f", :select => "u.id,f.name")
Any ideas?
...
in ruby you can have:
class ApplicationController < ActionController::Base
before_filter :require_login
end
i just wonder what is before_filter? it's a method from ActionController::Base?
and what will happen if i create an object of ApplicationController? The before_filter method will be run?
thanks!
...
This is a helper method I found in the ruby on rails application spree commerce.
I'm trying to better understand what's going on here, particularly with the capture() method on line 12, which I've never seen before. If there is a block given, it captures it, otherwise there is no content. But where does capture() come from? what is it d...
When I added my first gem dependency to config/environment.rb, (will_paginate), I'm encountering an error when running rspec as follows:
nik$ spec spec/
Missing these required gems:
will_paginate
You're running:
ruby 1.8.6.369 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
rubygems 1.3.7 at /Users/nik/.g...
I am running Ruby 1.9.1 & rails 2.3.8. Everything is installed fine as far as I can tell but when I run rake db:migrate I get this error:
Missing the Rails 2.3.8 gem. Please gem install -v=2.3.8 rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VE...
Hi folks,
I'm trying to write up a very basic rails app, but any time I write up even the simplest form I get the following error:
I18n::UnknownFileType in Posts#add
Showing /home/john/Websites/sandbox/rails-messing/app/views/posts/_form.html.erb where line #14 raised:
can not load translations from /usr/local/rvm/gems/ruby-head/gem...
The code below seems to do the same thing, but does one have better performance than the other, or they are the same? Thank you.
Code 1:
<% @posts.each do |post| -%>
post.doSomething
<% end -%>
Code 2:
<% for post in @posts %>
post.doSomething
<% end -%>
...
I'm working on an API wrapper for Viddler, which will eventually be made public, and I'm trying to figure out the best way to deal with authentication/API keys, specifically with usage within Rails applications in mind.
The easiest way to write the wrapper would be to just have the code create a new client each time, and the developer c...
I'm trying to remove dollar signs and commas from my form input (for example, $1,000.00 => 1000.00)
I have the following following line in my before_validation method in my model:
self.parents_mortgage = self.parents_mortgage.to_s.gsub!('$,','').to_i
This is causing any number to be put through to zero out. Is there something wrong w...
I have div tag named update_info in the view my_view.html.erb and update action takes several minute to complete in the controller my_controller.rb.
I'd like to update update_info div tag every seconds as update action's progress.
How can I do this?
Is it possible update view from the action's loop?
Or using Ajax?, if so, how can I ac...
Declarative authorization seems to require params[:id] to do its validation and I want to use paths like /profile and /dashboard where the user is stored in the session and not the URL. But it breaks. Any ideas on how I can do this without hacking the gem itself?
...
Hi, I have models order.rb , line_items.rb -- where line_item is belongs to order. I've added custom validations, as such an order should only have line_items all with same merchant_id
My question is : it seems the validation is working fine -- i am able to get the error whenever it is violated, but "line_item" records are still saved i...
i have installed sunspot search engine as mentioned in website http://www.linux-mag.com/id/7341/2/
every thing is installed correctly but it is showing error while starting a solr instance for sunspot when i run command
"sunspot-solr start -- -p 8983 -d /home/sharath/data/solr/devp"
it shows error
"sunspot-solr: command not found"
...
Short: I have an foreign key attribute and want to know what is the class (or reference table) of that foreign key field.
Context:
given 2 tables: users(id, [other fields]) and issues(id, user_id, assigned_to, [other fields])
Here is my active record of Issue (irrelevant parts are extracted)
class User < ActiveRecord::Base
...
end
...
How to reload only the div id on a page?
I just need to reload a certain div.
in my controller I have
def mycontrolleraction
...
render(:update) do |page|
reload_only_the_div('adiv'), :controller => 'my_controller'
end
end
Is this possible?
...