search for: current_pag

Displaying 20 results from an estimated 45 matches for "current_pag".

Did you mean: current_page
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...
2007 Dec 23
1
Rails: possible routing discrepancy
...pec: Parameters: {"action"=>"index", "controller"=>"abstracts", "index"=> {"select"=>"all"}} but there seems to be a discrepancy nonetheless. Then I started poking around in action_view/helpers/url_helper.rb, in current_page?, which is used by link_to_unless_current. Here''s that method: def current_page?(options) url_string = CGI.escapeHTML(url_for(options)) request = @controller.request if url_string =~ /^\w+:\/\// url_string == "#{request.protocol}#{request.host_with_port}# {request.r...
2004 Jul 16
1
/proc/xen/memory_target patch
...lloon/balloon.c Tue Jul 6 15:09:30 2004 --- obj-unstable/xeno-unstable.bk/linux-2.4.26-xen-sparse/arch/xen/drivers/balloon/balloon.c Fri Jul 16 15:12:11 2004 *************** *** 39,44 **** --- 39,45 ---- static struct proc_dir_entry *balloon_pde; unsigned long credit; + static unsigned long current_pages, max_pages; static inline pte_t *get_ptep(unsigned long addr) { *************** *** 221,270 **** return ret; } static int balloon_write(struct file *file, const char *buffer, u_long count, void *data) { ! user_balloon_op_t bop; /* Only...
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) and it works perfectly well. Unfor...
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'...
2006 Sep 05
1
Named routes and current_page? incompatibility
...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 match. Apparently there is a recent alternative so that _path on all named routes is also provided with _url. I tried this (e.g. using public_path(...)) and got an undefined_method error. Does anyone know what package this _path on named routes addit...
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 inde...
2009 Dec 23
3
Help with Navigation
I''m currently using CSS to style my navigational menu. I also have jquery at my disposal. The basic structure is like this: <div id="nav"> <div class="inner-container"> <div id="wrap"> <div class="inner"> <h2> <span class="h-ico
2005 May 21
0
How can I get a post-Routing translated url_for?
...esently visiting that page, and another shown if you are not presently visiting that page (e.g. an "active" and an "inactive" image for each state). The trouble I''m having is that when Routes are involved, or if there are other parameters in the URI, then calling current_page? is not sufficient. For example, if I have a Route that maps "" to {:controller => "info", :action => "welcome"} then the comparison involving @request.request_uri used in the current_page? method will not correctly deduce that "/" is in fact...
2010 Aug 12
13
[PATCH] GSoC 2010 - Memory hotplug support for Xen guests - third fully working version
...servation); if (rc < 0) - goto out; + goto out_1; pfn = PFN_DOWN(balloon_stats.hotplug_start_paddr + balloon_stats.hotplug_size); @@ -323,9 +271,10 @@ static int allocate_additional_memory(unsigned long nr_pages) balloon_stats.hotplug_size += rc << PAGE_SHIFT; balloon_stats.current_pages += rc; -out: +out_1: spin_unlock_irqrestore(&balloon_lock, flags); +out_0: return rc < 0 ? rc : rc != nr_pages; } @@ -337,11 +286,11 @@ static void hotplug_allocated_memory(void) nid = memory_add_physaddr_to_nid(balloon_stats.hotplug_start_paddr); - ret = xen_add_memory(ni...
2008 Dec 17
2
Help with link_to and its kin
...he following problem. I have created a navbar with a styled unordered list and I would like to apply class="current" to the tab for the current page. Currently I am using a large, cumbersome and ugly if..then block, rendering the class="current" into the html and link_tos with current_page?. I am absolutely sure this is a fairly common task for many rails developers, so common and easy in fact, that noone even bothers mentioning it on the web (a quick reference to the fact that I have unsuccessfully googled already). Help will be rewarded with chunky bacon. P&P Not included T...
2010 Aug 06
5
[PATCH] GSoC 2010 - Memory hotplug support for Xen guests - second fully working version - once again
...ERNEL); + + if (!r) { + rc = -ENOMEM; + goto out; + } + + r->name = "System RAM"; + r->flags = IORESOURCE_MEM | IORESOURCE_BUSY; + r_min = PFN_PHYS(section_nr_to_pfn(pfn_to_section_nr(balloon_stats.boot_max_pfn) + 1)); + r_size = (balloon_stats.target_pages - balloon_stats.current_pages) << PAGE_SHIFT; + + rc = allocate_resource(&iomem_resource, r, r_size, r_min, + ULONG_MAX, PAGE_SIZE, NULL, NULL); + + if (rc < 0) { + kfree(r); + goto out; + } + + balloon_stats.hotplug_start_paddr = r->start; + } + + pfn = PFN_DOWN(balloon_stats.hotplug_start_paddr +...
2008 Mar 15
4
[PATCH] Get requests with non-html referers
Hey, Aaron. Looks like that get with hash params patch you checked in had some side effects. Specifically, you''re testing if a referer is a Page (mechanize.rb:171), but the referer could also be a WWW::Mechanize::File. Like if the last page loaded was xml. Here''s a patch that addresses the issue. Thanks again, Mat -------------- next part -------------- A non-text
2009 Mar 24
12
MonkeyPatching ActiveRecord::Base class
...have an ancestor class defined, I think I am forced to open the ActiveRecord::Base class and patch it? May be I am wrong. Anyway, here is my code in the active_record_extensions.rb file that I created in the RAILS_ROOT/lib directory: module ActiveRecord class Base def self.search(search, current_page) if search.blank? paginate(:all, :page => current_page || 1, :per_page => 5) else paginate(:all, :conditions => ["name LIKE ?", "%#{search}%"], :order => ''name'', :page => current_page || 1, :per_page => 5...
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
2009 May 04
1
[PATCH] oggz: inefficient seeking
...it_begin); + } #ifdef DEBUG printf ("oggz_seek::guess: guess_ratio %lld = (%lld - %lld) / (%lld - %lld)\n", @@ -657,7 +663,16 @@ oggz_seek_set (OGGZ * oggz, ogg_int64_t unit_target) unit_at = reader->current_unit; unit_begin = 0; - unit_end = -1; + + og = &oggz->current_page; + + if (oggz_seek_raw (oggz, 0, SEEK_END) >= 0) { + ogg_int64_t granulepos; + + if (oggz_get_prev_start_page (oggz, og, &granulepos, &serialno) >= 0) { + unit_end = oggz_get_unit (oggz, serialno, granulepos); + } + } og = &oggz->current_page; @@ -682,6...
2005 Dec 07
5
[PATCH] Arch-neutral balloon driver
...st[i] = phys_to_machine_mapping[pfn]; + pfn = page_to_pfn(page); + mfn_list[i] = pfn_to_mfn(pfn); if (!PageHighMem(page)) { v = phys_to_virt(pfn << PAGE_SHIFT); @@ -444,6 +444,9 @@ IPRINTK("Initialising balloon driver.\n"); + if (xen_init() < 0) + return -1; + current_pages = min(xen_start_info->nr_pages, max_pfn); target_pages = current_pages; balloon_low = 0; @@ -465,7 +468,7 @@ /* Initialise the balloon with excess memory space. */ for (pfn = xen_start_info->nr_pages; pfn < max_pfn; pfn++) { - page = &mem_map[pfn]; + page = pfn_to_...
2006 Aug 01
8
Dumb views?
Hello again! I''ve another "what would you do in this situation" question. You''ve got 6 controllers, one named base. The other 5 controllers extend base. Currently they share one layout. Your layout displays navigation. However, there are two actions inside base for which you do not want navigation displayed (index, new). Do you... a) Add logic to your layout telling
2006 Jan 02
3
best to integrate dynamic navbar into layout
...e 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 awkward. In my layout: <%= navigation_bar %> In my application_helper.rb if @current_page == :home @home_link = ''<td width="80" class="button_background"><a href="/store/home"><img name="home" border="0" src="/images/home_dark.gif" alt="home"></a></td>'' else...
2008 Jan 09
5
Parallel indexing doesn''t work?
Hi, I''m trying to get parallelized ferret indexing working for my AAF indices, based on the example in the O''Reilly Ferret shortcut. However, the resulting indices after merging seem to have no actual documents. I went and made minimal changes to the example in the Ferret shortcut pdf, and indeed can''t get that to work either. I''d appreciate any help