Displaying 20 results from an estimated 7000 matches similar to: "Active Record Issue (I think)"
2011 Nov 12
4
No route matches [GET] "/microposts/304"
Hi all,
I''m learning Rails by Example (chapter 11), by Michael Hartl (
http://ruby.railstutorial.org/chapters/user-microposts#top) but I got no
route matches when I try to delete one micropost.
the _micropost html is...
<tr>
<td class="micropost">
<span class="content"><%= micropost.content %></span>
<span
2010 Aug 14
10
Redirecting after logging in
Hey everybody,
I''m trying to make an example of a small networking site, and when I log
in a user, it should redirect and show his profile, but I get the
following error:
NoMethodError in User#index
Showing app/views/user/index.html.erb where line #5 raised:
undefined method `screen_name'' for nil:NilClass
Extracted source (around line #5):
2: Your basic information
3:
2012 Jun 30
5
Problems with associations
Hello guys, I have two tables, tasks and projects, and each model I put:
Task.rb
class Task < ActiveRecord::Base
attr_accessible :user_id, :project_id, :name
belongs_to :project
end
Project.rb
class Project < ActiveRecord::Base
attr_accessible :name, :description
has_many :tasks
end
But when I go to my prompt and I make a SELECT with task, none project
is returned.
2013 Mar 02
3
Following railstutorial.org tutorial, how to make the microposts be seen by all?
I am a new learner of Ruby on Rails.
I followed through the railstutorial.org tutorial and I''m trying to
learn off the sample demo app where you can to make microposts and only
the people who are "following" you can see them.
If I wanted to make it so every user can see microposts as an additional
functionality, what are the steps to do that?
--
Posted via
2009 Nov 11
4
Schema dump does not reflect column size limit
Hi,
Everything is in the title.
With Rails 2.3.4 and MySQL 5.0.41:
If have a table like this:
+----------------+------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL |
2010 Mar 04
25
how to share variables in data migrations (up/down)
hi there,
How do we share variables in a given data migration?
For example,
the code below fails to work because "statuses" don''t seem to be in
scope for both up and down.
class AddDefaultValuesToStatuses < ActiveRecord::Migration
statuses = [
{
''details'' => ''details'',
},
{
2012 Jul 25
3
rails scope without raw sql
Hi, I''ve been stung when deploying a rails app to heroku, and I''m fairly
confident the problem is the difference between my local db sqlite3, and
the heroku standard free shared db which is postgres(i think).
I have a scope in my model that looks like this
scope :not_archived, :conditions => [''application_state != "archived"'']
The idea is I want
2012 Jul 18
3
Undefined method error
I have been working on a project based on Michael Hartl''s book Ruby on
Rails Tutorial in order to try to teach myself Ruby on Rails. However,
when it tries to render a form designed to allow a user to submit a
small message, I get an error saying, "undefined method `model_name'' for
NilClass:Class". It says the error is at line 1, which is "<%= form_for
2011 Jul 11
39
Help filling out a registration (I think it's called multi tenant)
Do you know when you are filling out a registration for a new account, and
you keep pressing next to fill the rest of the information in separate
pages?
I''d like to do that, but I have no idea how.
Basically I have a company model with its information, and a contacts model,
with belongs to my company (also each company has only one contact), and I''d
like for the user to fill in
2012 Jun 09
7
ActiveRecord::AssociationTypeMismatch in UsersController#update
Hi
Im trying to link my User model to a Teams model. I seem to be getting
the following errors. Any help would be great as Im just new to RoR
Thanks
error
ActiveRecord::AssociationTypeMismatch in UsersController#update
Team(#2183395560) expected, got String(#2174675960)
app/controllers/users_controller.rb:67:in `update''
app/controllers/users_controller.rb:66:in `update''
2009 Oct 12
15
We're sorry, but something went wrong on Tomcat
I am using JRuby and I have to deploy on Tomcat. My web app is working
fine in the dev envirmonment, with Mongel, but when I deploy on Tomcat
I get "We''re sorry, but something went wrong on Tomcat".
The problem is that production.log only shows:
# Logfile created on Mon Oct 12 12:54:36 +0100 2009-bash-3.00
The file permission and directory are 777.
Any idea how I can
2010 Mar 07
8
Parsing XML file with no style info with Hpricot
Hello,
I''ve been trying for hours to parse an XML using Hpricot. Usually it''s
not a problem. Here''s my simple code:
#This works and outputs the proper xml data
@url1 = ''http://www.sportingnews.com/stories/sportingnews/MLB/rss.xml''
@page1 = Hpricot(open(@url1))
<%= @page 1 %>
#This does not work, and I''m scratching my head
@url1 =
2010 Sep 16
6
acts_as_solr plugin fate?
Just wanted to see if I was using the latest acts_as_solr plugin, but
the URL <http://acts_as_solr.railsfreaks.com/> takes me to a GoDaddy
domain parking page.
Anyone know what''s happened to railsfreaks, and more particularly
this plugin?
--
Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
twitter: @hassan
--
You received this
2012 Jul 07
18
Problem processing text file after uploading
I''ve got a web-app currently partially working. The user uploads a .txt,
.docx or .doc file to the server.
Currently the model handles those files, saves some metadata (the
extention and orig filename) then saves the file to the hard drive. Next
it converts the doc and docx files to plain text and saves the output to
a txt file.
My problem is I want to copy the plain text contents of
2009 Oct 23
10
Rspec Tutorial
Hi Everybody,
Greetings!!
I want to use rspec for my applications. Please guide me with the Rspec
tutorial.
I want a good example to start with.
Please help me by providing good tutorials on Rspec to start with.
I actually followed the example from http://rspec.info
Please guide me on more examples.
Waiting for your reply.
--~--~---------~--~----~------------~-------~--~----~
You received
2009 Apr 05
5
Use a value from a different model
Hello,
I cannot find the issue and it drives me crazy :(
let''s simplify. I have 2 models: saving and purchase_type
a *saving* corresponds to a *purchase_type* e.g. new sourcing or
renegotiation
a saving has exactly one purchase_type and a purchase_type has many
savings.
when I try to display the list of savings and their purchase type
(name, not Id), i get the dreaded "You have a
2012 Sep 04
5
Associations and Math between Models
I''ve setup two models, 1 and 2, that are associated by
has_and_belongs_to_many. I''m trying to get an attribute from model_1 to use
in a method in model_2. When I use the code below, I get an error saying
''undefined method model_1_id''. What am I missing? Thanks!
Model_2.rb
Class Model_2 < ActiveRecord::Base
...
has_and_belongs_to_many :model_1
def
2009 Oct 22
11
UFT8 String looks great in MySql, garbage in browser
Hi,
I have some seed data in MySql which contains non-ASCII characters (as
you''d imagine as these are worldwide placenames that I''m storing). In
MySql on the command line they look great, they''re all formatted
perfectly, including Arabic and Chinese characters and they look great.
However, when I ask my Rails model for one of these fields, and render
that in the
2010 Dec 31
9
Headers in ActiveResource
I am creating a rails app that is a gui wraping a restful web service
that uses a websso for authentication. This websso sets a series of
headers that I need to pass from the request to the
ActiveResource.find methods. As this is stuff like username etc it is
going to be different for each request. I can find examples on how to
set headers for all requests not just one.
Does anyone know of a way
2009 Jan 08
5
There is already an object named 'schema_migrations' in the database
I''ve created a table in a SQL Server database using a migration,
successfully.
I''ve tried to change the name of a column in the table and got the
error message above when running ''rake db:migrate''.
Previously I have developed using MySQL and Sqlite and migrations have
worked successfully. This is an error I have not seen before.
Has anybody seen this and worked