Displaying 20 results from an estimated 10000 matches similar to: "Simple question on rails routing"
2009 Nov 02
5
Working round 'invalid byte sequence'
I am a very amateur Rubyist who, amongst other things, likes to use a
simple Rails app to query my company''s MySQL config database. The
server I now use to do this has got 1.9.1 and Rails 2.3.3. I''ve now hit
the ''problems'' related to 1.9 and string encoding, which means that when
Rails try to display, say, E acute characters, it throws an invalid byte
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories ,
basically i want to fix one product(e.g hp dv7....) to some categories
(notebook,17"notebooks...)
i made a table named categorization(incuding category_id,product_id
fields) then in models i write these codes below
class Product < ActiveRecord::Base
has_many :categories, :through => :categorizations
2009 Jul 13
3
undefined method error from atom builder
I have a simple controller that takes a request, looks up some data
and then returns the results as either HTML or Atom. The HTML response
works fine, but the Atom Builder is blowing up with an undefined
method error that I can''t figure out. It seems to be failing when the
ActiveRecord instance is passed to the ''entry'' method and it tries to
build the URL via the
2009 Apr 03
7
RJS not rendering correctly when mime-type is 'iphone'
I have an iPhone version of my site, and for some reason none of the
rjs works when viewing the iPhone version. This happens instead:
ActionView::MissingTemplate (Missing template controller_name/
update.erb in view path app/views)
The rjs works fine when viewing the site normally, and it worked when
viewing the iPhone version prior to upgrading Rails to 2.3.2.
Additional info: I have
2010 Dec 29
5
Beginer: Question about routing on Rails 3
I bought this book about rails for beginers (head first Rails)
and its quite simple and good for someone who has no clue about Rails
(or any other language)
On chapter two it talks about routing
but unfortunately the book is for rails 2 and i have rails 3 installed
on my mac.
The line i have to enter in the config/routes.rb of my application is:
map.connect ''/ads/:id'',
2010 Jun 14
7
"NoMethodError in AdminController#index" error
hi, im totally a newbie so i have got no idea whatsoever why i got this
error, the thing that happend was i was doing a little coding along with
the lynda.com rails series that i got this error.
well as u can see this is the error which i get on terminal, but there
is another one in browser too which says : "NoMethodError in
AdminController#index " u can see it in the picture here :
2009 Oct 28
6
undefined method `^' for "e":String
I''m attempting to learn Ruby on Rails, but these errors aren''t helping.
I''m currently trying to follow the lessons available on
www.learningrails.com. I received this error after trying to visit a
page generated by using the scaffold command. Actually, this is all I
did up until the error:
rails sample2 -d mysql
mysqladmin -u root -p create sample2_development
ruby
2009 Oct 27
14
Authlogic Password confirmation is too short Error. NEED HELP.
Hi:
I am using authlogic, and following railscast tutorial. I am running
into this error code with the password confirmation.
authlogic password confirmation is too short
Has anyone experienced this error? I need your help.
Thanks in advance for your help.
2009 Aug 19
10
acts_as_list / acts_as_tree / acts_as_nested_set - which one
I am creating forum application which needs usage of acts_as_list or
acts_as_tree or acts_as_nested_set.
I am unable to decide among these. please could some one recommend from
their experience?
--
Posted via http://www.ruby-forum.com/.
2009 Aug 13
10
default value if textfield is empty
Hey all,
im not sure where to set a default value if a textfield is empty?
For now i do it in the controller, and check if the submitted parameter
is blank.
But this seems not to be the best solution...
Thanks for your help!
--
Posted via http://www.ruby-forum.com/.
2009 Aug 19
27
First App- Error 500
I''ve created a simple hello world app that doesnt appear to serve up
the view greeting.rhtml. :<
Any ideas ?
The error message is from development.log is...
# Logfile created on Tue Aug 18 16:49:55 -0400 2009/!\ FAILSAFE /!\
Tue Aug 18 16:50:34 -0400 2009
Status: 500 Internal Server Error
unknown error
PS . It does show the default web page ok at http://localhost:3000
just not
2010 Nov 16
15
acts_as_taggable, undefined method 'empty?'
I''ve tried out ''acts_as_taggable'', ''acts_as_taggable_on'' and
''acts_as_taggable_on_steroids'' and all of them output "undefined
method ''empty?''" with the tag_cloud action.
I am following the guides precisely. Yet I can find no references to
this error anywhere, so I must be doing something wrong...
I am on
2011 Jan 06
14
Forceing PUST vs. POST in form
I am experimenting with a combined form. I wish to force the HTTP verb
for this form to PUT. However, it always uses POST when submitted and I
cannot determine why.
The view template code is:
<%=form_for( @user,
:html => {
:class => :edit_user_role,
:id => :edit_user_role_form,
:method => :put },
:url => user_roles_url( @user )
)
2009 Oct 01
3
Using Ruby on Rails to edit a script?
Is ROR a good fit if I want to edit and expand on a developed script
like RoundCube( http://roundcube.net/ )? I''m planing to edit it for my
business as an order/transcript application.
If anyone is interested this link is what I want to make.
http://handoff.wordpress.com/
2009 May 01
5
Layout antics
I have a strange problem with my layout file. I think it may be due to
nested partials, but removing the deepest nested partial call does not
clear the problem.
I have an application wide layout (application.html.erb) that works as
expected - loads images, javascript, css etc for my application.
So http://localhost:3000/patients --> fine
http://localhost:3000/patients/new --> fine
2009 Sep 25
12
uniqueness validation perplexity
I want to write a validate routine to check to enforce that a position
must be unique in a category. (In another category, it doesn''t have
to and shouldn''t need to be unique.) I write this code which works
happily for new items:
def position_in_category_not_unique
@items = Item.find( :all, :conditions => [ "category_id = ? AND
position = ?", category_id,
2010 Dec 21
8
Rails - escape_javascript without all the \n\n\n\n\n
Hello, I''m using escape_javascript to return a partial to the browser
via ajax.
Something like:
$("#inject").html("<%=escape_javascript(render :partial =>"feed/
index")%>");
Problem is escape_javascript ends up outputing all kinds of wasted
space like
\n\n\n\n\n \n
Is there anyway in Rails to escape_javascript more
2009 Jul 19
3
Edit function now outputs HTML only
For some reason my new action works fine but my edit outputs nothing
but raw HTML. Anyone have any ideas?
2009 Sep 01
5
Deep nested associations on the same Model
This could be a lot simpler than I think and I''m just missing something
obvious!
I''m working on a creative collaboration app whereby one user could
submit a Story and this can then be forked by another user and worked on
seperately. To acheive this I have a has_many association within the
same Story model as such:
class Story < ActiveRecord::Base
has_many
2010 Dec 20
11
rails code to sql
Is there a relatively easy way to do this code in sql?
@categories=Category.all.reject{|n| n.blank?}.sort{|a,b| a.name
<=>b.name}.collect{|t| [t.name,t.name.downcase.gsub('' '',''_'')]}
--
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