Displaying 20 results from an estimated 200 matches similar to: "Named routes and current_page? incompatibility"
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 02
3
best to integrate dynamic navbar into layout
I''ve been trying to come up with a good way to integrate a dynamic
navbar into my layout. By dynamic, I meas that each link has 3 images.
Normal, rollover, and dark for the current page. I have it working but
it seems like there should be a better way. Here is how I did it,
please let me know if there is a better way. Rails makes so many things
simple, that this seems very
2007 Jul 30
2
build a menu (li.selected)
Hello,
when I try to create a menu I found the following limitation:
the event li.selected does not work
and, I am not being able to show an image when the menu option is
selected
in my CSS exists the following code:
.menu li.selected {
...
background: transparent url(/images/menu_selected.gif) 100% 1px
no-repeat;
...
}
in file: ...\layouts\application.rhtml
exists the following code:
<div
2006 Jan 04
2
Navigation Helper
I am attempting to integrate a main navigation section into my web
application. Naturally the easiest and DRY way to do this would be to
either include it in a layout, or as a partial. The only problem is
that I want the link for the current page to have its own css id
("current"). The only way I can think to accomplish this is to just
include the navigation in every page, but this is
2005 Jul 13
1
link_to_unless_current woes...
Hi !
I have the following in my navigation area:
<%= link_to_unless_current image_tag(''events.gif'', :height => 34,
:alt => ''Events''), :controller => ''events'' %>
Works nice untill I am on the events page, in which case the generated
code looks like:
<img alt="Programs" height="34"
2006 Mar 30
11
Illegal char \002? Need to restart Rails to see changes?
Hi all,
I''m developing an app on a home Windows computer and using
SVN/Capistrano to deploy to a Linux server. I''m encountering some
bizarre behavior that I think has something to do with Linux and Windows
text file types, but I''m not sure.
What''s happening is that, whenever I edit my view files and reload the
page in my local browser, I see errors saying
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
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)
2009 Dec 29
0
Using current_page? With An Edit Route
current_page?(:action => ''edit'', :controller => ''admin/products'')
fails with an ActionView::TemplateError (No route matches ...) unless
I''m in the edit action or I provide the :id.
Route:
/admin/products/:id/edit(.:format) {:action => ''edit'', :controller =>
''admin/products''}
I understand why this
2005 Dec 15
6
Navigation menu
I have a navigation menu that contains a link per controller in my
application.
This menu is the same for all controllers, but I want this behaviour:
<a>Users</a>
<span>Statistics</span>
and
<span>Users</span>
<a>Statistics</a>
depending on the page you''re currently on.
I''ve put a <render :partial =>
2008 Sep 30
0
Tabbed Menus - link_to_unless_current
This is more difficult than I originally anticipated. Any help in
figuring this out is most appreciated:
This is a code snippet from my header.rhtml (or erb) file that draws
tabbed menus:
<ul>
<% [["Home", "/home" ],
["Positions", "/company" ],
["Leads",
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 Jun 15
11
[PATCH] helper to create fb css stylized table
I attached a rails helper implementation of the fb_table described here:
http://wiki.developers.facebook.com/index.php/Facebook_Styles
I included testing and comments. I hope you find it useful.
Curiously, it''s really a small extension of FBML.
Richard
-------------- next part --------------
Index: test/rails_integration_test.rb
2008 Dec 25
0
link_to_unless_current & I18n.t
How can I use link_to_unless_current with I18n.t localization?
--
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group,
2006 Feb 15
3
Applying list-item format depending on action
What would be the best way to do this? I have a list and I want one
item to be underlined (depending on the action that I am on). Do I?:
Have a bunch of if statements:
if :controller => ''admin'', :action => ''list''
<li id="current">Pages</li>
else
<li>Pages</li>
end
What do you think? Is there a
2006 Jul 23
4
Anything like with_scope for ActionController?
There are areas of my application that "want" to use a url structure
like
domain/<human_readable_param>/<Module>/<Controller>/<Action>/<Id>
Please note that the human readable parameter I need to inject is NOT
related to the <id> being used by the action/controller pair. It''s
identifying a container object whose contains are operated
2008 May 01
20
link_to meta programming question
I am trying to create a dynamic menu using the following construct:
<%- menu_list = [ ''first'', ''second'', ''third''] -%>
<ul>
<%- menu_list.each do |m| -%>
<%= link_to "List All #{m.titlecase.pluralize} <m>_path %>
<%- end -%>
</ul>
What I cannot determine is what I have to do to replace
2006 Jun 30
0
Accessing View methods from Model?
Hey. I have Menu model which recursively renders a menu. Now I want to
use link_to and link_to_unless_current methods from View helpers inside
my Model. Any ideas how I coulkd do that?
--
Posted via http://www.ruby-forum.com/.
2010 Jan 05
0
Problem with associating comments with blog posts on same page
Hi,
I will admit I am very new to ruby and I am trying to do something
that is not in any tutorials I have found. If you see a more
conventional way to do some of the things I am trying to do, please
let me know.
What I am trying to accomplish. People can edit the comments on the
same page as the listing of posts. The problem is that when I go to
create the comment, it is not getting associated
2009 Jun 02
1
[PATCH] ocfs2: Adjust rightmost path in ocfs2_add_branch.
In ocfs2_add_branch, we use the rightmost rec of the leaf extent block
to generate the e_cpos for the new added branch. In the most case, it
is OK but if there is a gap between the the root(or branch) 's rightmost
rec and the leaf, it will cause kernel panic if we insert some clusters
in it. The message is something like:
(7445,1):ocfs2_insert_at_leaf:3775 ERROR: bug expression: