Displaying 20 results from an estimated 100000 matches similar to: "[root :to => "home#index"] not working"
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
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 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:
2011 Dec 02
20
Need Some Guides on Solr with Rails.
Hi Everyone,
I am pretty new to Rails. I have very little idea about everything. But
for my new project i have been asked to do some research on Solr search
and implement it on Rails. Please provide me some link on tutorials and
guides about Solr on Rails. Trouble is... have to do it by tomorrow.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are
2013 May 31
22
accidentally created a rails app in the home folder
Im a new user - I just installed rails, following directions here:
http://rubyonrails.org/download
however, when it came time to make a rails new path/etc/etc I get this
message:
Can''t initialize a new Rails application within the directory of
another, please change to a non-Rails directory first.
The only complication during the download was that I had to upgrade from
version 1.8.6 to
2012 Jun 13
7
Cmd line interface for ruby on rails app
Hi,
I have a rails app running which provides an interface to create/update
data stored in a DB. How do i develop a cmd line interface to do the
same i.e i should be able to retrieve/update data to a DB.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email
2010 Apr 30
5
accessing one controller from another
I have a posts controller and a pages controller for ''static'' pages ie
my homepage
I want to have the latest post shown on the homepage.... accessing the
posts controller from within the pages controller
Is there a way I can do this?
thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on
2011 Mar 04
7
Example of work with mongo
Hi there,
I''m newbie here and I have a problem with the connection with MongoDB.
The connection among Rails and MongoDB works, but I don''t know, how to
print only one "column" from document.
If I''m trying following a part of code:
puts db["testCollection"].find_one().inspect
So I''will get the entire structure of BSON, as:
2010 Mar 16
6
SQL result to String conversion
Hello All,
I am very new to Ruby on Rails and I have a quick question for you all,
which is as follows:
I have this following line of code in an partial that renders itself on
the posts/index view:
Created By (User): <%= User.find(:all, :select => ''name'', :conditions =>
["id = ?", 1]) %>
(I am hard-coding that ''1'' there)
Now, when I run
2010 Jun 08
8
rails, ajax, json, and script
Could someone please demonstrate the code to send both json (or xml) AND
javascript (to be executed) in a single Ajax request?
Is this even possible?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2011 Jul 22
9
Active Record Issue (I think)
I''m following a rails tutorial (Hartl) and it''s been fine so far, but
something doesn''t seem to be working right.
I have two basic models so far, "User" and "Micropost".
class User < ActiveRecord::Base
has_many :microposts
end
class Micropost < ActiveRecord::Base
belongs_to :user
end
If I do something like:
"first_user =
2010 May 21
8
Designing An Application (UML, Class Diagrams)
Hi
Is there any freeware anybody would recommend for showing database
models and how they relate to each other? I''m picking up an app
another developer left in a mess and I''m trying to sort it out.
Diagrams would be a great help.
Suggestions?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this
2011 Aug 23
12
remove a table with migration
HI, guys,
How to remove a table with migration, i saw a drop down method in
migration created file , how can i use that ?
thank you.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email
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 Apr 04
4
Running SSL in Development Environment
Hello,
I am building an application that consists of two areas; a website and
an API. I would like the website to use HTTP and the API to use HTTPS.
How can I set this up for my Development Environment?
I am using Thin, which I can start using the --SSL flag. However this
means any HTTP urls will fail. As far as I can see it is impossible to
have a server handle both HTTP and HTTPS, so how do
2009 Dec 23
4
html parser / assertions in a model
I am using http.get in a model to parse html code returned from a Oracle
server.
My first try was to use assertions (assert and assert_select) to test
and parse the html code. But I have problems including the methods in
the model. Have tried both "include" and copy/paste to get assertion
methods into my model. Works as a model, but I get load errors when I am
using the model from a
2010 Dec 01
6
Mongrel, .htaccess, cpanel, rewrite, Mongrel::HttpParserError
I just installed my RoR application on my ISP''s server.
This is a Cpanel environment and it creates a .htaccess file:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^xyz.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.xyz.com$
RewriteRule ^(.*)$ "http\:\/\/127\.0\.0\.1\:12001\/$1" [P,L]
in a public_html directory. (I changed my domain name in the text above
to xyz because we are
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''
2012 Sep 21
9
Using PostgreSQL with RoR on windows. Help!
So I just got involved in a huge team project with RoR and PostgreSQL.
But I can''t find anywhere on the internet to find a proper way to put
them together. I did find one but it is for iOS :-/
http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast
I have them both installed and the gem package for postgres also. the
database.yml is already configured. I just
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.