I'm using NetBeans + Rails 2.3.8.
I notice that whenever I generate a model, the migration filename for it includes the date and time:
Model Name: User
Migration File Name : 20100916172053_create_users.rb
But when I see books (like Agile Web Development with Rails), the (rake-generated examples int it) all show simple numbers like 0...
Hello,
I have a Project Index View that shows all the projects in an app
I want that view to show if the user signed in is a member or not....
In the Project Index View I have:
<% if teammember? %>
<td>Request to Join</td>
<% else %>
<td>Already Joined</td>
<% end %>
Then in the project's controller I h...
So this is my problem. I used Capistrano to deploy my Rails 3 app to an Ubuntu server, which has Phusion Passenger 3 installed. Everything should have worked normal, but I kept getting this error message.
Could not locate Gemfile in /var/www/rails/releases/20100916074325. (Bundler::GemfileNotFound)
The directory in the error messa...
I have the following line of Rails 3
In the project.rb model this works great:
permissions.find_by_project_id(1).role.name
However in a projects_helper it errors "undefined method `role' for nil:NilClass":
if Permission.find_by_project_id(project_id).role.name.nil?
.
.
Why is that?
What I really want is:
current_user.permission...
I would like to have my users specify custom URL paths such that those paths are placed in front of my site's name, i.e. if I have a site called www.orion.com, I'd like a user to be able to create his own little home page at johnny.orion.com.
I have successfully managed to implement orion.com/johnny, which works implemented by adding ma...
Hi.
I have a problem using Bundler and Cucumber with Rails 3.
When I run $ rake cucumber I get the following output:
bundle exec /usr/local/bin/ruby -I "/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-
0.8.5/lib:lib" "/usr/local/lib/ruby/gems/1.9.1/gems/cucumber-0.8.5/bin/cucumber" --profile default
(in /home/<username>/practice/rails/...
Hi,
I am new to rails.
Could you help me with a good tutorial on how to parse CDATA content in ruby on rails.
I have learnt to use Feed-zirra to parse the content but I am not able to parse content from the websites which use CDATA.
If it is not possible to do it with feed-zirra could you help me with alternatives.
Looking forward f...
I have created a complex object in rails with a principle parent object "Resume" it has a number of child objects for each section("objective_section", "contact_section", etc), is there a way I can fetch all associated objects to the parent object Resume?
...
I want to deploy a small rails application. What is the easiest / fastest way to do so? Capistrano seems to be oversized for small applications.
Thanks for your answers!
...
UPDATE: FIXED!!!!!
As I suspected it was a config that was messed up somehow - much hair pulling ensued. For some reason "require 'test_help'" was deleted from test_helper.rb, added it back in and all the tests are in a transaction now.
This smells like a basic config issue but I can't figure out what. Rails 2.3.5, Ruby 1.8.7 patch 173...
Hi all!
Is there a way I can turn this:
<%= f.datetime_select :truckleft, :start_year => Date.current.year, :end_year => Date.current.year, :include_blank => true %>
into a helper, because I need to use it a lot throughout the form
I do however would like the rest to stay in the view file,
like the:
<%= form_for(@trip) do |f| %>
...
Hello.
I want simple thing. Translate routes with I18n like this
get I18n.t('routes.login') => "devise/sessions#new", :as => :new_user_session
I made file initilizers/locale.rb with
I18n.default_locale = :cz
It works perfectly when i run 'rake routes', but when i run server it ignore default locale and throw 'translation missing me...
Rather than
<input type="submit" />
I want to output
<button>
using the button_to method (rails 3.0.0)
Is this possible?
...
I have three models
class Collection < ActiveRecord::Base
has_many :presentations
has_many :galleries, :through => :presentations
end
class Gallery < ActiveRecord::Base
has_many :presentations
has_many :collections, :through => :presentations
end
class Presentation < ActiveRecord::Base
belongs_to :collection
belongs_to...
I was always under impression that bang version of Array methods are only different in the way that they modify object in place.
Turns out, some of them like compact!, reject!, flatten!, uniq! also return nil if no changes were made bang bang bang
Check out this:
ruby-1.8.7-p302 > [1,[2]].flatten!
=> [1, 2]
ruby-1.8.7-p302 > [1,2].fl...
Complete rails novice and something just isn't clicking.
On my home page /home - I use devise, so I have a check .
<% if user_signed_in? %>
<%= render "getting_started" %>
<% else %>
Welcome!
<%= link_to "Sign up", new_user_registration_path%>
<% end %>
At the moment getting_started.html.erb has some instructions and then I'm di...
Ruby doesn't seem to have any method to convert my text to HTML before putting it on the page, so newlines do not appear. What am I missing?
...
Is there a way to use external XML (or JSON) as a datasource for models in Rails. E.g. some models use the database for getting data, others "ping" external services for XML.
...
Hi ,
This is the question , I asked many . But didn't get a satisfactory answer . Hope I'll get it from Stackoverflow folks .
What is the advantage of Ruby on Rail have over python or perl ?
I have django and GAE with python . Then why should I go for Heroku/Engineyard with Ruby on Rails ?
Thanks
J
...
What is the Rails 3 way to comment out One Line or Multiple lines of code in a View? And so it doesn't show up in the HTML Source
...