search for: link_to_unless_current

Displaying 19 results from an estimated 19 matches for "link_to_unless_current".

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: &lt;img alt=&quot;Programs&quot; height=&...
2008 Sep 30
0
Tabbed Menus - link_to_unless_current
...["Documents", "/document"], ["My Account", "/account" ], ["Help", "/help" ]].each do |label, controller| %> <%= open_tag "li" %> <%= link_to_unless_current(label, {:controller => controller} ) { |label, controller| content_tag("span", label, :class => "current") } %> </li> </ul> This implements "tabbed menus&qu...
2007 Dec 23
1
Rails: possible routing discrepancy
...ot 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 /><%= link_to_unless_current ''Writing'', writing_path %> and I have a spec which calls this page, and checks to see that ''Writing'' is not a link: describe "''/writing/''" do controller_name :abstracts integrate_views it "should not link '...
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-/JYPxA39...
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
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 =>
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...
2007 Jul 30
2
build a menu (li.selected)
...e 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 id="menu"> <ul> <li><%= link_to_unless_current "home", :controller => "home" %></li> <li><%= link_to_unless_current "Resources", :controller => "resources", :action => "list" %></li> </ul> Anyone can tell me how can I do this? and tell me links sour...
2006 Mar 30
11
Illegal char \002? Need to restart Rails to see changes?
...unexpected $, expecting kEND _erbout.concat " <h3 class=\"house_title\">" ^ Extracted source (around line #3): 1: <p>Hi</p> 2: <div class="house"> 3: <h3 class="house_title"><%= link_to_unless_current h(house.address), :action => ''show'', :id => house.id %></h3> 4: <%= link_to_unless_current image_tag("/images/houses/small/front", :size => ''150x100''), :action => ''show'', :id => house.id %> 5: <%= &...
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
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 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/.
2006 Mar 09
1
disable link to current page
Hi, When writing a .rhtml file how can i detect which url is being rendered and disable the links? Even more, I may want to change some other css classes for other elements based on which url is the current one. Thanks, Peter
2010 Jan 05
0
Problem with associating comments with blog posts on same page
...y pulls the post id and saves the comment as belonging to that post. Now, when I try to incorporate everything all into a very easy page to navigate I can''t use the same code associations and my comments fail. app/views/posts/index.html.erb <% div_for( post ) do %> <h3><%= link_to_unless_current h(post.title), statemant %></h3> <p class="timestamp"> Posted <%=h time_ago_in_words(post.created_at) %> ago </p> <p> Approved: <%= h(post.approved) %> </p> <p class="post_post"> <%= simple_format h(post.body) %>...
2006 Jun 07
6
Links on the left hand side - are components necessary?
Hello, Maybe this is super-trivial... I need to have a list of links on the left hand side of my application, for *every* single page. So, I''ve created a layout called "main" (main.rhtml) under view/layouts, and included >layout "main"< in pretty all of my controllers. main.rhtml has, amongst all the other HTML stuff: <%= render_component
2007 Jan 25
4
How to change the menu depending on the controller/method?
Hello, I''m still dtarting with ruby on rails. And I''m trying to have a menu depending on the current controller/method. Here is what I was thinking of (please tell me if there''s a better way to do it): I have a database with menu_groups (corresponding to controllers) and menu_elements(corresponding to methods). Each menu_element belongs to one menu_group. I created a
2006 May 23
3
image_tag problem
Hiall, I want to make an image_tag from within a controller in order to be able to present a link (with a status image) in a view. Here is my controller method (in file webca_controller.rb, hence WebcaController) def untouched_status_image_tag image_tag("open", { :alt => "Offen", :title => "Offen", :size => "12x12", :class =>
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
2004 Oct 25
1
Rails 0.8: Just shy of 100 additions, changes, tweaks, and fixes!
...tation: The html_options have a special feature for creating javascript confirm alerts where if you pass :confirm => ''Are you sure?'', the link will be guarded with a JS popup asking that question. If the user accepts, the link is processed, otherwise not. * Added link_to_unless_current as a UrlHelper method [Sam Stephenson]. Documentation: Creates a link tag of the given +name+ using an URL created by the set of +options+, unless the current controller, action, and id are the same as the link''s, in which case only the name is returned (or the given block...