search for: current_pages

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

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 in my application_helper.rb, the page renders
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
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 a...
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
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
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)
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?
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
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(nid,...
2008 Dec 17
2
Help with link_to and its kin
Hi Everyone I am a new user of Ruby and Rails, and would like some help with the 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
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 + b...
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
I am trying to monkey-patch the ActiveRecord::Base class to incorporate a generic search class method so that it can be used by all model classes which need this functionality. Since model classes directly inherit from ActiveRecord::Base and unlike controllers and helpers, do not have an ancestor class defined, I think I am forced to open the ActiveRecord::Base class and patch it? May be I am
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
I have a 1.1G Ogg file with vorbis and theora. oggz_seek_units() takes 14 seconds to find a position in the file towards the end. Now, the function guess() in oggz_seek() guesses a position at about 1.5G and then slowly searches back until it finds the end of the file (continously seeking beyond the end of the file and then calling read which returns 0). Then it does a linear scan from the
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_pa...
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
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
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