I am going through my first RoR tutorial and came up on an action controller routing error. I have checked my code at least 8 times, but can't figure out the issue. I'm sure this will happen again in the future. My question is, in general, how should I go about solving these errors? If it's relevant I am using RVM, Rails 3.0.1 and Ru...
At my wits end with this!
My current set up is:
- Ruby 1.9.2
- Rails 3.0.1
- pg (0.9.0)
My $PATH right now looks like this:
/Users/fjones/.rvm/gems/ruby-1.9.2-p0/bin:/Users/fjones/.rvm/gems/ruby-1.9.2-p0@global/bin:/Users/fjones/.rvm/rubies/ruby-1.9.2-p0/bin:/Users/fjones/.rvm/bin:ARCHFLAGS=-arch
x86_64:/opt/local/bin:/opt/local...
I am having trouble accessing the attributes of a join in Rails3.
There is two models/tables : Place and Address. One place can have many addresses (i.e. a specific street address, a "corner of" address, etc.). For historical reasons, the tables do not follow standard Rails conventions:
class Place < ActiveRecord::Base
set_table_name ...
I created a model that had a string primary_key.
The Create action in Ruby on Rails gave me the following error:
Couldn't find Theme with ID=0
My Theme table has no ID column, but a string column called name which is the primary key.
After searching everywhere, I experimented myself with the Create action inside the theme_controller....
I am looking at a few different ways to get Rails 3 working (database is not important right now) on Windows 7, would appreciate some advice on different stacks and IDEs. I do want to go with an IDE for several reasons such as code completion and because i will be using the ruby debugger (which i find easier to use on a GUI)
Netbeans fo...
Hello,
I have several Rails applications with version 2.3.8, which I run using the thin server. I want to install Rails 3.0.1 on the same machine for testing purposes.
The installation worked fine, but after installing Rails 3.0.1, running Rails 2.3.8 applications with thin fails with this error:
>> Using rails adapter
Missing the Rai...
Hi all,
I'm developing an application in which a Course belongs to a user. I would like to predefine a number of courses, such that a Course's template details are then copied into the users course details. From this initial point each user has a one-to-one mapping with a course.
I'd like to know the best place for the static attribut...
I have a build task in rake defined with the following dependencies:
desc 'Builds the App'
task :rebuild_dev => ["solr:start", "db:drop", "db:create", "db:migrate", "spec", "solr:stop"]
The first task "solr:start" starts the Solr Indexing server. Now, if the build fails (may be in spec tests fail), the "solr:stop" task is not executed...
I want to be able to create multiple user accounts with the same login (because of the case a user deletes his account... and then sign up with the same login). I am using authlogic and rails3_acts_as_paranoid.
But there is a problem: Authlogic validates the uniqueness of the login field - and IGNORES the default_scope(:conditions => {:...
I just installed rails 3.0.1, when I try to do something like rails server i get the error message below.
note the first line saying it couldn't find rails gem 3.0.0.rc:
Could not find gem 'rails (= 3.0.0.rc, runtime)' in any of the gem s
ources. (Bundler::GemNotFound)
How can I make my rails3 app use rails 3.0.1?
Thanks,
-p.s. the f...
Hello, tricky problem.
I have a controller that is:
def create
.
.
@project = Project.find(params[:project]
@Log = Logs.create(params[:action]).merge(:project_id => @project.id))
...
end
The issue hereis that sometimes when DEF CREATE, I'll have a project and I want to record that. Other times I won't and that's perfectly fine, I st...
I'm learning RSpec 2 with Rails 3 and while it's been going along quite nicely so far, I'm having a problem testing the helper link_to_unless_current in a view. What I've been trying to do is use a simple assert_select from a view spec to determine if a link is being generated in the following partial view (HAML):
%article.post{ :id => ...
Hi,
I want to build a wizard like multi-step input form for my model.
I want to stick to rest practices as long as possible.
The individual steps in the wizard don't have much inter-dependency so to avoid the round trip to the server, I want to store the whole data on client side using JQueryUI tabs or similar.
I have following ques...
I'm trying to add CodeRay and RedCloth to a Rails 3 application and am getting some strange behaviors. I followed this RailsCast, but since Rails 3 escapes the HTML by default, my HTML is being escaped a couple of times. What do I need to change?
module ApplicationHelper
def coderay(text)
text.gsub(/\<code( lang="(.+?)")?\>(.+?)\<...
Hello, I'm looking for suggestions on creating a model/scaffold for Photos
I want a user to be able to create a album that contains 1 or more photos.
Current idea:
album
id, name, user_id
photos
id, name, album_id
Thoughts?
Thanks
...
Hello,
Here's what I'm trying to do...
Controller
def create
.
.
if @project.save
format.js { @project }
end
end
View
window.location = "<%= redirect_to(@project, :notice => 'Project was successfully created.') %>";
In Sum,using AJAX to create a project. When the create is done, I want to redirect the user to the project.....
I'm trying to add some Markdown styling to my Rails 3 blog application. This should be something simple, but I can't get it to work.
I have kramdown in my Gemfile:
gem 'kramdown'
I ran bundle install. I have an application helper called kramdown
module ApplicationHelper
def kramdown(text)
require 'kramdown'
return Kramdown...
Hello,
I'm rails I've been building a web app.
But the web app is completely different than what the landing page (sign in, register, about, etc should look like)
How do rails developers handle this? Different layouts? Different CSS files? etc..
what's cleanest? Thanks
...
I have a Rails 3 application that needs to use both Prototype and JQuery libraries. Now I am having problems when it comes to making different kinds of remote calls. I am able to do a remote_function call and return RJS and that works just fine. But, on another page I want to do a form_for :remote => true, but that fails - it just sub...
I am new to the Rails community, and I also like to try and follow the conventions that the community uses. In the Rails 3 books I have been reading I have noticed that the authors have been opting for the old :key => value syntax versus the new Ruby 1.9 style key: value. Do Rails developers generally adhere to one style and not use the ...