Displaying 20 results from an estimated 6000 matches similar to: "Design question: Redirection to a "create" action."
2010 Aug 21
4
No route matches?
Hi all,
I''m coming from the PHP world and I''m trying to learn Ruby and Rails.
I''m having a problem where I keep getting the error "No route matches /
home/view" even though I have it defined it. I''d appreciate any help
on this. I''m using rails 3.0 and the setting for the environment is
"development".
# routes.rb
2005 Dec 18
0
Caching question
I''ve got caching mostly working but it''s acting string with the index/home.
On the site I have a redirect the points http://nutritionreality.com at
http://nutritionreality.com/home
I do this in routes.rb by:
map.index '''', :controller => ''home'', :action => ''index''
Caching happens on index (index.html gets created in
2006 Jun 17
2
RJS templates - newbie
I am trying to test drive RJS templates in Rails 1.2. Here is what I
did:
create table categories (name varchar(255) );
rails RJSTest
cd RJSTest
rake update_javascripts
script/generate controller home index add
script/generate model category
Note: When I did a rake update_javascripts, I did not see any output.
I configured database.yml to talk to mysql.
Next I wrote
2008 Apr 14
2
Problems with nil object
Hi to all. I''ve a very big problem. I know this can seem very loing, but
please, try to read it. I have a simply blog, with posts and their
comments. I''ve two tables in my db, posts, with post id, text and
comments_count to store the number of comments-children of each post (as
recomanded to do in AWDWR); and the table comments, with comment id,
post_id for the post
2008 May 16
0
Problem with :action => 'destroy' in url_for
url_for( :controller => ''foo'', :action => ''destroy'', :id => 1 ) => ''/
foo/1''
url_for( :controller => ''foo'', :action => ''destroy_x'', :id => 1 ) => ''/
foo/destroy_x/1
url_for( :controller => ''foo'', :action => ''destroy'', :foo_id => 1 )
2006 Feb 14
0
Help with Eager Association
I''ve gotten eager associations to work before, but for some reason
this isn''t working out for me this time. I''ve been scratching my head
but can''t quite figure out the nuances of what works and what doesn''t
work.
I''ve got 3 models: profile, widget_configuration and widgets
profile.rb --
has_many :widget_configurations
2011 Feb 14
1
Curiosity in my production.log: */*
In my production.log, I usually see lines like this:
Processing by HomeController#index as HTML
But sometimes I see the line like this:
Processing by HomeController#index as */*
At first I thought perhaps those calls were made by a bot, but after
looking at it closer it looks as those they are generated by normal
users. I have no idea, first, how that line could have been generated,
and
2006 Jun 26
0
Action caching with params
I was attempting to cache an action that had a URL like this:
http://foo.com/controller/action?years[]=2005&years[]=2006&bar=5&baz=blue
which returns different data than, say
http://foo.com/controller/action?years[]=2004&years[]=2005&bar=6&baz=red
However, the cached fragment would always be named
foo.com:3000/controller/action.cache, no matter what parameters where
2006 Feb 27
0
Mapping '':action/:id/:controller/'' doesn''t work
Hello People,
(I am not good at ROR yet. This post could be very lame.)
I am going playing with routes.rb.
Well, pretty much any combination of mapping works, a part from:
map.connect '':action/:id/:controller/''
In this case, the request is routed; however, I get:
---------------------------------------
Showing app/views/inputs/start.rhtml where line #8 raised:
No url can be
2011 Jun 11
7
"Stack level too" deep with @controller.hi
Hi again, sorry for many questions. In mi HomeController, I have the
"hi" method, in this method I use an "if" for show a different message
for a registered user or a guest. When I call in "home/index" my
method "hi", show me this error message:
"Stack level too deep"
class HomeController < ApplicationController
def hi
if (current_user)
2012 Aug 28
4
ArgumentError in HomeController#index
Hey guys, I''m new to ruby/rails and trying to sort something...
I just created an app with composer,
http://railsapps.github.com/rails-composer/
I used the command:
rails new myapp -m
https://raw.github.com/RailsApps/rails-composer/master/composer.rb
I set up the rails server, and tried to load the app on localhost:3000
However, I end up with:
ArgumentError in HomeController#index
2006 Jun 27
2
Serve an image up from an action
What I am really trying to do is use the file_column plugin for the file
uplaod/storage (to a non-application directory), but serve up the images
on my own (without the mage_tag url_for_file_column technique)
In the java world, I would simply do something like this:
<img src="myImageServlet?id=1">
and myImageServlet would simply return the appropriate mime headers and
data
2006 Jan 21
1
clearing/expiring the ''index'' action.
Hi all,
I''m having problems trying to expire the ''index'' action of a controller.
In short,
expire_action :action => ''index''
doesn''t work, but
expire_fragment (url_for :action =>
''index'').gsub(/\/index/,'''').split("://").last
works fine and deletes the cached page as expected.
I
2006 Jun 22
2
MVC architecture
Hi,
I want to creat a GUI accessible via the web with ruby to interface some
matlab implementation ... so I extended Ruby with C++ and then matlab :)
that works perfectly: I have finaly a Ruby class I can call whenever I
want to lunch my matlab algorithm ;)
the point is now I have to make the GUI in HTML with Rubby on rails and
Damn! I don''t get how works the MVC architecture in Ruby
2012 Apr 19
2
method value passing in rails
in my ruby on rails application, i have one controller
class HomeController < ApplicationController
def home
puts "name.....#{@name}"
end
def branch
*//HERE HAVE TO GET THE ABOVE FUNCTION VALUE @name*
end
end
What am trying to do, i have to get the @name value in method branch. i
could show the value in function home, but i didn''t get that in
2006 May 06
3
define the meaning of this error
hi,
i just have this error, can anyone tell me what it means and how i can
fix it thanks.
NameError in HomeController#index
uninitialized constant Student
RAILS_ROOT: ./script/../config/..
Application Trace | Framework Trace | Full Trace
This error occured while loading the following files:
student.rb
Request
Parameters: None
Show session dump
---
user: !ruby/object:User
attributes:
2006 Oct 23
0
Invoking a remote (AJAX) action via double click
I have a list of images on one of my pages, and I would like for the
act of double-clicking on any of them to do a remote request to an
action. In this case, I''d like to pop up a redbox that is a dialog
about the item I clicked on. I found some example code like this:
<%= image_tag "image.jpg",
:class => "image",
:ondblclick =>
2008 May 08
0
Controller/action not working in url
Hey guys,
i am facing some problems in calling an action. see details:
in sale_items controller, i have a function
def saleedit
--code--
render ( :action => ''saleedit'')
end
and i have a file in view/sale_items/saleedit.html.erb.
okay. now i have one more view view/sale_items/new.html.erb. in this
file i have a form like this:
<% form_tag url_for(:action =>
2005 Mar 02
2
form action in mail (actionmailer)
Hi everyone. : )
I meet problem when use form tag in actionmailer. (content-type is text/html, surely)
I want to use form action in actionmailer''s view (.rhtml) for some reason.
1. I use start_form_tag helper method as normally, but how I can ?
I did <%= start_form_tag :action => "http://myhostname/mycontroller/myaction" %> or
<%= start_form_tag :action =>
2006 May 31
7
Getting 22 elements
Hello,
I''ve done
===
class HomeController < ApplicationController
def index
@country = Country.find(:all, :include => "cities")
end
end
===
And rhtml is:
===
<% @country.each do |country| %>
<h1><%= country.name %></h1>
<% country.cities.each do |city| %>
- <%= link_to city.name, :action =>