Displaying 20 results from an estimated 30000 matches similar to: "Using current_page? With An Edit Route"
2010 Sep 10
10
current_page? inside controller
Is there any easy way of using something like current_page? method
from ActionView::Helpers::UrlHelper inside controller ?
I have routing like:
resources :addresses
resources :mailing_addresses, :controller => ''addresses''
And I would like to do a check in my controller that would look like
this:
class AddressesController
def index
if current_page?(live_addresses_path)
2008 Oct 12
0
How to test with RSpec a Rails plugin using “link_to” and “current_page?”
I''m writing a Rails plugin that builds up a menu in a view. I''m using
*link`_`to* to build the link and *current_page?* to set
class="active" on the current page.
I''ve *include*d *ActionView::Helpers::UrlHelper* so I can use
*link`_`to*.
To get *current`_`page?* working in the view, I''ve had to inherit the
current class (apparently ActionView::Base)
2005 May 21
0
How can I get a post-Routing translated url_for?
Is there a way to ask the Route system what controller and action
mapping will be used, given a hash containing :controller and :action?
I am trying to generalize the case where there is a button bar (e.g.
tabbed pages) having one image shown if you are presently visiting
that page, and another shown if you are not presently visiting that
page (e.g. an "active" and an
2006 Sep 05
1
Named routes and current_page? incompatibility
Hi,
I have some named routes defined e.g. map.public and wish to use
link_to_unless_current() to disable link.
However, as I''ve seen from forum discussions and the API doc, the issue
lies with the fact that the named_route_url() method generated by a
named route does not default to only_path = true like url_for.
Therefore, the current_page? within link_to_unless_current() will not
2006 Jan 29
4
current_page?()
Can someone give me a working example of current_page?(), because I''ve
been trying to get this to work for a while now. I''ve been trying this:
if current_page?(".*")
@test = "asd"
end
but get a "undefined method `current_page?''" when I put it in my
controller or application.rb. If I put it in my application_helper.rb,
the page renders
2009 Dec 03
2
Dynamic Paths
Hey there,
I''m in the muck of a major rails project, and need a bit of advice. Google
isn''t much help in this case, so I came here.
I''m trying to set up a URL structure as follows:
url.com/username/blog/post_id
where the user has_many posts and the post belongs_to user. I''m using the
friendly_id plugin to enable easy lookup with the user''s username,
2010 Jul 22
0
TemplateError while rendering german special characters
Hi
I am using following versions of Ruby and Rails on arch linux
[hardik@sunshine: kandibank ]$ ruby --version
ruby 1.9.1p429 (2010-07-02 revision 28523) [x86_64-linux]
[hardik@sunshine: kandibank ]$ rails --version
Rails 2.3.8
I am using the sqllite database in development mode.
I can store a string having German special characters (umlauts) without
a problem i.e. Müller.
But when Rails
2011 May 04
1
is not allowed as an instance variable name error
Hey all,
I get error like this:
ActionView::TemplateError
(`@content_for_details_view_builder__-626960428'' is not allowed as an
instance variable name) in app/views/shared/_details_view.haml:
searchlogic (2.4.27) lib/searchlogic/rails_helpers.rb:75:in
`fields_for''
searchlogic (2.4.27) lib/searchlogic/rails_helpers.rb:64:in
`form_for''
2009 May 22
1
rails 2.3.2, active scaffold, nested, ActionView::TemplateError (undefined method `format_column' for #<ActionView::Base:
Before I dig in any further (since I have no idea where to go from
here...)
Has anyone been succcessful with 2.3.2, AS, and nested scaffolds?
I have the latest of AS and the render_component plugin via
% script/plugin install --force git://github.com/lackac/render_component.git
-r rails-edge
I have an AS user_controller:
active_scaffold :user do |config|
...
2007 Dec 23
1
Rails: possible routing discrepancy
Hey all, I''m seeing a strange behavior in my spec that I can''t
account for. I''ve got a route that looks like this:
map.writing \
''/writing'',
:controller => ''abstracts'', :action => ''index'',
:index => { :select => ''all'' }
and I have template code that looks like this:
<br
2006 Jan 16
1
Problem with production on Dreamhost - TemplateError
Hi all,
I''m trying to deploy my app to Dreamhost for production. I''ve managed to
solve all of the Error 500s and it''s *almost* working.
When I try and view a page, I get a TemplateError that I don''t get when
I''m running from home using InstantRails under Windows.
The error is:
ActionView::TemplateError (undefined method `user?'' for
2010 Aug 13
0
Rails 2 and Rails 3 in the same gemset leads to errors
Hi.
I am pretty new to ruby (and those gems) and rails.. Until now I
thought that all rails application have some kind of integrated
version management (RAILS_GEM_VERSION in Rails 2 and gem ''rails'' in
Rails 3). And therefore I thought that having Rails 2 and Rails 3 in
the same gem repository (in my case gemset under rvm) wouldn''t be a
problem. But during installing
2010 Oct 11
5
Object lost in memory/trashed?
Hi,
I''ve got a problem on which I''ve spent many hours, and I can''t get a
clue on what is happening... I hope someone here will be able to help
me.
Here is the situation : my Rails app uses acts_as_commentable and
acts_as_bookmarkable on a Diagram model. Everything''s working OK
individually: I can create a comment on a Diagram, bookmark it, and so
on.
Now,
2009 Mar 09
4
undefined method `symbol_path'
I am getting following error while creating a new topic using RESTful
design. But, everything works fine when I use <% form_tag :action =>
:create do %> .
ActionView::TemplateError (undefined method `symbol_path'' for
#<ActionView::Base:0xb72a2e40>) on line #3 of topics/new.rhtml:
1: <h1>New Topic</h1>
2:
3: <% form_tag :topic, :url => topics_path do %>
2011 Dec 16
4
nil object Error
hi all,
i am getting following error ,i can''t figure it out why and from where
it is coming ?
please help me out to resolved this error if anyone knows about this issue.
i am using following env.
O.S:Windows XP
Ruby:ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
Rails:Rails 2.3.11
Gem:1.6.2
ActionView::TemplateError (You have a nil object when you didn''t expect
2007 Jan 25
0
Fragment Cache in ActionMailer
I have a controller which iterates through a group of people and
dynamically generates an email for each person, it is a bit DB heavy so
caching would really help.
Adding ''include ActionController::Caching::Fragments'' to my
BookingMailer model produces this error:
ActionView::TemplateError (undefined local variable or method
`perform_caching'' for
2008 Mar 13
0
ActionView::TemplateError when FQL query does not return any results
I submitted this as a bug here:
http://rubyforge.org/tracker/index.php?func=detail&aid=18799&group_id=4187&atid=16130
However, I just realized that I probably should have posted here first. Has
anyone else had a similar experiance with queries that don''t return results?
I have the following FQL Query:
"SELECT uid FROM user WHERE has_added_app = 1 AND uid IN (SELECT
2009 Apr 19
2
Upgrading from Rails 1.3.x to 2.3.2 - text_field_with_auto_complete not working
Folks,
I am trying to upgrade code base from 1.3.x to 2.3.2 and not
surprisingly, lot of things are broken.
''text_field_with_auto_complete'' is not working for me - it gives the
following error:
ActionView::TemplateError (undefined method
`text_field_with_auto_complete'' for #<ActionView::Base:
0x7f0ceb6b8290>)
I already have installed auto_complete -
ruby
2007 Apr 05
5
Odd error handling in ActionView#compile_template causes WSOD
If a view file cannot be compiled (eg it has a block with a missing
''end'' statement), I''m experiencing WSODs - the browser reports a lost
network connection, rather than the helpful compilation error that we
used to have.
When the compilation fails, ActionView#compile_template raises this
error :
TemplateError.new(find_base_path_for(file_name || template), file_name
||
2010 May 28
8
form helpers don't seem to work with RJS files...
I’ve been spending a great deal of time chasing this problem. Hopefully
someone sees something obvious I’m doing wrong. Basically anytime I try
to call fields_for from an RJS file or within a partial in the RJS file,
I get the following error. My goal is simply to load a partial into a
div. The fields in this partial require fields_for though. And that’s
where the problem lies.