Search Results

Search found 602 results on 25 pages for 'victor lin'.

Page 12/25 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • SimpleDB to ActiveResource. Rails

    - by Victor P
    Im looking for a way to map an ActiveResource to SimpleDB I want to avoid plugins/gems as all I have used are outdated/buggy/not mantained It doesnt seem hard, I wonder if any of you have succesfully implemented a rails app with simpleDB as an Active Resource. How did you do it? Thanks.

    Read the article

  • differences between using wmode="transparent", "opaque", "window" for an embedded object on webpage

    - by Jian Lin
    when embedding a Flash object with the <object and <embed tag, there is an attribute called "wmode". It seems that most of the time, wmode="transparent" is the same as wmode="opaque" as the Flash doesn't actually have any transparent color so that the bottom HTML element is to be shown. As a result, "opaque" should be faster than "transparent" since it require less processing for transparency, yet most of the time i see Flash object embedded with "transparent" instead of "opaque". "opaque" is needed so that other HTML element won't be covered up by the Flash object. (such as a menu item that pops up an extra sub-menu won't be covered up by the Flash object). By the way, is there formal documentation for wmode's "opaque", "transparent", and "window"? I was only able to find blogs that describe it but not the formal documentation. thanks.

    Read the article

  • C# Operator Overloading post-fix increment

    - by Victor
    I'm coding a date class and am having trouble with the post-fix increment (the prefix increment seems fine). Here is the sample code: public class date { int year, month, day; public date(int d, int m, int y) { day = d; month = m; year = y; } static public date operator ++(date d) { return d.Next(d); } } The method "Next(date d)" takes a date and returns tomorrows date (I left it out for brevity). I'm to young in C# to understand why the prefix is fine but postfix increment does nothing. But remember in C++ we would have to have two methods instead of just one - for prefix and postfix increments. Also no errors or warnings on compile.

    Read the article

  • Position of builtInZoomControls in WebView and MapView

    - by Mathias Lin
    I noticed that the position of the builtInZoomControls in WebView (bottom, horizontal right) is not consistent with the default position in the MapView (bottom, horizontal center). 1) Why is that not consistent? (Probably a question to be asked to Google) 2) Is there a way to horizontal center the builtInZoomControls of the WebView without applying custom Zoom controls? Or is that the only way?

    Read the article

  • overflow-y hides page contents in a webkit browsers (Chrome and Safari)

    - by Victor F
    Hi, I am currently making our website to be supported by all major browsers and I've met a very strange problem - oveflow-y attribute caused my data to be hidden. Below I've got an oversimplified code sample that works in IE and Firfox, but which doesn't work in Safari and Chrome. This is a 100% valid code and I am not sure why it doesn't display properly in webkit browsers. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body style="height: 100%;"> <form action="Webkit_Problem.html" style="height: 100%;"> <table style="height: 100%;> <tr> <td> <div style="overflow-y: auto; height: 100%;> THIS SHOULD BE VISIBLE </div> </td> </tr> </table> </form> </body> </html> http://www.alocet.com/VictorsTestFolder/Webkit_Problem.html (Live sample here) The only way to get it working is either remove the height:100% attributes for div or a table tag (which will ruin the purpose of my html), or add height:100% to html tag Does anyone has any suggestions? Thank you

    Read the article

  • Disable themed Window Border

    - by Jimmie Lin
    In Windows XP's CMD, the Luna border isn't applied to it. Is it possible to do it in a similar way in Visual C# Winforms, for an application? I just wonder how it's done, of course I am not going to force any of my applications to not use the beautiful XP/Aero theme :P Thanks.

    Read the article

  • How to write scripts that can run in bash and csh?

    - by Victor Liu
    I'm not sure if this is even possible, but is there a way to write shell scripts that can be interpreted by both the Bourne shell as well as C shell? I want to avoid simply checking for the shell and running a shell-specific code. If this is possible, are there any guides on how to do it? I have always written my scripts for Bourne shell syntax, and I know next to nothing about csh, so this may be a stupid question. I have Google'd for the differences between shells, but there is little information (as far as I can tell) on its implications for scripting.

    Read the article

  • Replace html tags

    - by Victor Sanchez
    I need replace some tags in HTML: Original: <span class="a">text</span><span class="a">text</span><span id="b">text</span> Result: <b>text</b><b>text</b><span id="b">text</span> I tried using HTML::Manipulator but did not succeed.

    Read the article

  • XML parsing to plist iPhone SDK

    - by victor
    Hi, guys. Could you, please, help me with parsing of this XML code: <?xml version="1.0" encoding="utf-8"?> <stuff> <parts> <part id='327'> <name>Logitech MX500</name> <serial>618163558491989</serial> <account>ASDALSKD</account> <number>987 789 456</number> <alarm>alarm1</alarm> </part> <part id='846'> <name>Logitech MX510</name> <serial>871351434945431</serial> <account>KJSDAKLJFA</account> <number>454 564 131</number> <alarm>alarm2</alarm> </part> </parts> <info>Information</info> </stuff> And save data to plist file stuff.plist in this format: 327 NSArray Name NSString Logitech MX500 Serial NSString 618163558491989 Account NSString ASDALSKD Number NSString 987 789 456 Alarm NSString alarm1 846 NSArray Name NSString Logitech MX510 Serial NSString 871351434945431 Account NSString KJSDAKLJFA Number NSString 454 564 131 Alarm NSString alarm2

    Read the article

  • mysqli prepared statements select *

    - by Victor Dallecio
    I've spent this sunday trying to find what is wrong to the following code as it is not counting the rows. Could somebody help me with it? Thanks! /*check if same IP has visited today*/ if ($stmt = $mysqli->query('SELECT * FROM table WHERE colum1 = ? AND colum2 > DATE_SUB(NOW(), INTERVAL 1 DAY)')) { $stmt->bind_param('s', $ip); /* execute query */ $stmt->execute(); /*number of rows */ /*store result when using prepared statements*/ $stmt->store_result(); $row_cnt = $stmt->num_rows; printf("Result set has %d rows.\n", $row_cnt); $stmt->close(); }

    Read the article

  • How can I read this IIS error log?

    - by Victor Rodrigues
    I'm using Debug Diagnostic Tool, trying to understand why around 5% of the requests that are sent to my webservice just crash, without necessarily throw any error inside my application. One of the errors this tool took is below. Can anyone here understand exactly what could be happening? Thanks! [6/17/2010 5:32:58 PM] First chance exception - 0xe0434f4d caused by thread with system id 1736 [6/17/2010 5:32:58 PM] Stack Trace ChildEBP RetAddr Args to Child WARNING: Stack unwind information not available. Following frames may be wrong. 1c5bec58 79ef2bbc e0434f4d 00000001 00000001 kernel32!RaiseException+0x3c 1c5becb8 79fccf80 0a6d4998 00000000 00000000 mscorwks!GetMetaDataInternalInterface+0x84a9 1c5bed7c 656cab0e 0a6d4788 1c5bed98 65221345 mscorwks!StrongNameErrorInfo+0x103dc 1c5bed88 65221345 0a6cefb0 1c5bedf8 1c5bee08 System_Data_ni+0x57ab0e 1c5bee0c 79e7e1f3 1c147158 1c147158 0a6d0710 System_Data_ni+0xd1345 1c5bee24 79f7c770 0a6d0710 1c147158 026f25a8 mscorwks!DllUnregisterServerInternal+0x21d7 1c5beee8 79e71b4c 0a6cd9b8 0a6cd994 026f409c mscorwks!CorExitProcess+0x28f9a 1c5bef00 79e821b9 1c5befd8 00000002 1c5befa0 mscorwks+0x1b4c 1c5bef80 79e96531 1c5befd8 00000002 1c5befa0 mscorwks!DllUnregisterServerInternal+0x619d 1c5bf0c8 79e96564 1c531688 1c5bf228 1c5bf120 mscorwks!CoUninitializeEE+0x2ead 1c5bf0e4 79e96582 1c531688 1c5bf228 1c5bf120 mscorwks!CoUninitializeEE+0x2ee0 1c5bf0fc 79f87a83 1c5bf120 1c5bf2e0 79fa6a6b mscorwks!CoUninitializeEE+0x2efe 1c5bf2ec 79f87be2 00629d50 0a6cdae8 0a6d0e04 mscorwks!CorExitProcess+0x342ad 1c5bf3ac 792d5348 00629d90 00000086 1c5bf3c8 mscorwks!CorExitProcess+0x3440c 1c5bf3fc 792d50f6 00629d90 00000086 066a1ae0 mscorlib_ni+0x215348 1c5bf434 792d4fde 00000000 00000000 0a6cd944 mscorlib_ni+0x2150f6 1c5bf488 65e1098e 0a6cd944 00000000 00000000 mscorlib_ni+0x214fde 1c5bf4cc 65e10665 66082f99 0a6ca144 00000000 System_Web_Services_ni+0x13098e 1c5bf4fc 65e10ff7 026c1054 0a6ca168 0a6ace9c System_Web_Services_ni+0x130665 1c5bf510 6dde7666 1c5bf54c 660adb16 6ddd2c34 System_Web_Services_ni+0x130ff7 1c5bf518 660adb16 6ddd2c34 0a6ace8c 0a6c883c System_Web_Extensions_ni+0x1c7666 1c5bf54c 6608132c 1c5bf578 0a6c883c 00000000 System_Web_ni+0x18db16 1c5bf588 6608c5c3 1c5bf5b0 0a6abecc 0a6c8b4c System_Web_ni+0x16132c 1c5bf5dc 660808ac 0a6c8218 0a6abecc 026c0d48 System_Web_ni+0x16c5c3 1c5bf5f0 66083e1c 0a6c883c 026c1054 0a6c883c System_Web_ni+0x1608ac 1c5bf62c 66083ac3 026bc67c 0a6c8400 1c5bf6b0 System_Web_ni+0x163e1c 1c5bf63c 66082c5c 8984fdc8 79e7a6b8 1c5bf858 System_Web_ni+0x163ac3 1c5bf6b0 79f9811e 00000002 01b93b00 026cf6e4 System_Web_ni+0x162c5c 1c5bf768 79f9822b 0017a0d0 1c5bf970 1c5bf9e8 mscorwks!CorExitProcess+0x44948 1c5bf7c4 79f98691 0017a0d0 1c5bf970 1c5bf9e8 mscorwks!CorExitProcess+0x44a55 1c5bf9d0 6a2aa19b 00000001 01b93b00 00000000 mscorwks!CorExitProcess+0x44ebb 1c5bf9f0 6a2aa19b 023ad3f0 01b93b00 00000002 webengine!BufferPoolReleaseBuffer+0x1bb 1c5bfa28 79e72032 79e821f6 e5934469 0017a0d0 webengine!BufferPoolReleaseBuffer+0x1bb 00000000 00000000 00000000 00000000 00000000 mscorwks+0x2032 [6/17/2010 5:33:00 PM] First chance exception - 0xe0434f4d caused by thread with system id 3252 [6/17/2010 5:33:00 PM] Stack Trace ChildEBP RetAddr Args to Child WARNING: Stack unwind information not available. Following frames may be wrong. 01d0ecd8 79ef2bbc e0434f4d 00000001 00000001 kernel32!RaiseException+0x3c 01d0ed38 79fccf80 02748edc 00000000 00000000 mscorwks!GetMetaDataInternalInterface+0x84a9 01d0edfc 656cab0e 02748ccc 01d0ee18 65221345 mscorwks!StrongNameErrorInfo+0x103dc 01d0ee08 65221345 027434d0 01d0ee78 01d0ee88 System_Data_ni+0x57ab0e 01d0ee8c 79e7e1f3 1c147158 1c147158 02744c30 System_Data_ni+0xd1345 01d0eea4 79f7c770 02744c30 1c147158 026f25a8 mscorwks!DllUnregisterServerInternal+0x21d7 01d0ef68 79e71b4c 02741ed8 02741eb4 026f409c mscorwks!CorExitProcess+0x28f9a 01d0ef80 79e821b9 01d0f058 00000002 01d0f020 mscorwks+0x1b4c 01d0f000 79e96531 01d0f058 00000002 01d0f020 mscorwks!DllUnregisterServerInternal+0x619d 01d0f148 79e96564 1c531688 01d0f2a8 01d0f1a0 mscorwks!CoUninitializeEE+0x2ead 01d0f164 79e96582 1c531688 01d0f2a8 01d0f1a0 mscorwks!CoUninitializeEE+0x2ee0 01d0f17c 79f87a83 01d0f1a0 01d0f360 79fa6a6b mscorwks!CoUninitializeEE+0x2efe 01d0f36c 79f87be2 00629d50 02742008 02745324 mscorwks!CorExitProcess+0x342ad 01d0f42c 792d5348 00629d90 00000086 01d0f448 mscorwks!CorExitProcess+0x3440c 01d0f47c 792d50f6 00629d90 00000086 066a1ae0 mscorlib_ni+0x215348 01d0f4b4 792d4fde 00000000 00000000 02741e64 mscorlib_ni+0x2150f6 01d0f508 65e1098e 02741e64 00000000 00000000 mscorlib_ni+0x214fde 01d0f54c 65e10665 66082f99 0273e664 00000000 System_Web_Services_ni+0x13098e 01d0f57c 65e10ff7 026c1054 0273e688 0a6ace9c System_Web_Services_ni+0x130665 01d0f590 6dde7666 01d0f5cc 660adb16 6ddd2c34 System_Web_Services_ni+0x130ff7 01d0f598 660adb16 6ddd2c34 0a6ace8c 0272cce4 System_Web_Extensions_ni+0x1c7666 01d0f5cc 6608132c 01d0f5f8 0272cce4 00000000 System_Web_ni+0x18db16 01d0f608 6608c5c3 01d0f630 0a6abecc 0272cff4 System_Web_ni+0x16132c 01d0f65c 660808ac 0272c6c0 0a6abecc 026c0d48 System_Web_ni+0x16c5c3 01d0f670 66083e1c 0272cce4 026c1054 0272cce4 System_Web_ni+0x1608ac 01d0f6ac 66083ac3 026bc67c 0272c8a8 01d0f730 System_Web_ni+0x163e1c 01d0f6bc 66082c5c 8984fdc8 79e7a6b8 01d0f8d8 System_Web_ni+0x163ac3 01d0f730 79f9811e 00000002 01b93b00 026cf6e4 System_Web_ni+0x162c5c 01d0f7e8 79f9822b 000dcea8 01d0f9f0 01d0fa68 mscorwks!CorExitProcess+0x44948 01d0f844 79f98691 000dcea8 01d0f9f0 01d0fa68 mscorwks!CorExitProcess+0x44a55 01d0fa50 6a2aa19b 00000001 01b93b00 00000000 mscorwks!CorExitProcess+0x44ebb 01d0fa70 6a2aa19b 023ad3f0 01b93b00 00000002 webengine!BufferPoolReleaseBuffer+0x1bb 01d0fac8 79e79cba 79e79ccd 0000000d 00000000 webengine!BufferPoolReleaseBuffer+0x1bb 01d0facc 79e79ccd 0000000d 00000000 79ec3f4b mscorwks+0x9cba 01d0fad8 79ec3f4b 79e7c82c 79ec3f53 f818458d mscorwks+0x9ccd 00000000 00000000 00000000 00000000 00000000 mscorwks!CreateAssemblyNameObject+0x22f40 [6/17/2010 5:33:37 PM] Thread exited. Exiting thread system id - 2144. Exit code - 0x00000000

    Read the article

  • Looking for a better design: A readonly in-memory cache mechanism

    - by Dylan Lin
    Hi all, I have a Category entity (class), which has zero or one parent Category and many child Categories -- it's a tree structure. The Category data is stored in a RDBMS, so for better performance, I want to load all categories and cache them in memory while launching the applicaiton. Our system can have plugins, and we allow the plugin authors to access the Category Tree, but they should not modify the cached items and the tree(I think a non-readonly design might cause some subtle bugs in this senario), only the system knows when and how to refresh the tree. Here are some demo codes: public interface ITreeNode<T> where T : ITreeNode<T> { // No setter T Parent { get; } IEnumerable<T> ChildNodes { get; } } // This class is generated by O/R Mapping tool (e.g. Entity Framework) public class Category : EntityObject { public string Name { get; set; } } // Because Category is not stateless, so I create a cleaner view class for Category. // And this class is the Node Type of the Category Tree public class CategoryView : ITreeNode<CategoryView> { public string Name { get; private set; } #region ITreeNode Memebers public CategoryView Parent { get; private set; } private List<CategoryView> _childNodes; public IEnumerable<CategoryView> ChildNodes { return _childNodes; } #endregion public static CategoryView CreateFrom(Category category) { // here I can set the CategoryView.Name property } } So far so good. However, I want to make ITreeNode interface reuseable, and for some other types, the tree should not be readonly. We are not able to do this with the above readonly ITreeNode, so I want the ITreeNode to be like this: public interface ITreeNode<T> { // has setter T Parent { get; set; } // use ICollection<T> instead of IEnumerable<T> ICollection<T> ChildNodes { get; } } But if we make the ITreeNode writable, then we cannot make the Category Tree readonly, it's not good. So I think if we can do like this: public interface ITreeNode<T> { T Parent { get; } IEnumerable<T> ChildNodes { get; } } public interface IWritableTreeNode<T> : ITreeNode<T> { new T Parent { get; set; } new ICollection<T> ChildNodes { get; } } Is this good or bad? Are there some better designs? Thanks a lot! :)

    Read the article

  • In languages which create a new scope each time in a loop block, a new local copy of the local loop

    - by Jian Lin
    It seems that in language like C, Java, and Ruby (as opposed to Javascript), a new scope is created for each iteration of a loop block, and the local variable defined for the loop is actually made into a local variable every single time and recorded in this new scope? For example, in Ruby: p RUBY_VERSION $foo = [] (1..5).each do |i| $foo[i] = lambda { p i } end (1..5).each do |j| $foo[j].call() end the print out is: [MacBook01:~] $ ruby scope.rb "1.8.6" 1 2 3 4 5 [MacBook01:~] $ So, it looks like when a new scope is created, a new local copy of i is also created and recorded in this new scope, so that when the function is executed at a later time, the "i" is found in those scope chains as 1, 2, 3, 4, 5 respectively. Is this true? (It sounds like a heavy operation). Contrast that with p RUBY_VERSION $foo = [] i = 0 (1..5).each do |i| $foo[i] = lambda { p i } end (1..5).each do |j| $foo[j].call() end This time, the i is defined before entering the loop, so Ruby 1.8.6 will not put this i in the new scope created for the loop block, and therefore when the i is looked up in the scope chain, it always refer to the i that was in the outside scope, and give 5 every time: [MacBook01:~] $ ruby scope2.rb "1.8.6" 5 5 5 5 5 [MacBook01:~] $ I heard that in Ruby 1.9, i will be treated as a local defined for the loop even when there is an i defined earlier? The operation of creating a new scope, creating a new local copy of i each time through the loop seems heavy, as it seems it wouldn't have matter if we are not invoking the functions at a later time. So when the functions don't need to be invoked at a later time, could the interpreter and the compiler to C / Java try to optimize it so that there is not local copy of i each time?

    Read the article

  • Rspec Faker has_one fail in view

    - by Victor Martins
    I' trying to fix this for hours... I have this on a controller rspec test: it "show action should render show template" do task = Task.make task.mission = Mission.make get :show, :id => task response.should render_template(:show) end But it fails rendering the view because of this: <%=h @task.mission.name %> I don't get it... :/

    Read the article

  • Rails Layout Rendering with controller condition

    - by Victor Martins
    I don't know what's the best way to doing this. On my application.html.erb I define a header div. My default controller ( root ) is a homepage controller. And I wish that if I'm at index of the homepage the header is rendering with some content, but all other controllers render another content inside that header. How can I make a condition in that header div to render different content based on the controller that's being rendered?

    Read the article

  • Recreation of MySQL DB using "mysql mydb < mydb.sql" is really slow when the table has tens of milli

    - by Jian Lin
    It seems that a MySQL database that has a table with tens of millions of records will get a big INSERT INTO statement when the following mysqldump some_db > some_db.sql is done to back up the database. (is it 1 insert statement that handles all the records?) So when reconstructing the DB using mysql some_db < some_db.sql then the CPU is hardly busy (about 1.8% usage by the mysql process... I don't see a mysqld either?) and also the hard disk doesn't seem to be too busy... Last time, the whole restore process took 5 hours. Is there a way to make it faster? Such as, when doing mysqldump, can it break the INSERT statement into shorter ones, so that the mysql doesn't need to parse the line so hard when restoring the DB?

    Read the article

  • Can Git or Mercurial be set to bypass the local repository and go straight to the central one?

    - by Jian Lin
    Using Git or Mercurial, if the working directory is 1GB, then the local repository will be another 1GB (at least), residing normally in the same hard drive. And then when pushed to a central repository, there will be another 1GB. Can Git or Mercurial be set to use only a working directory and then a central repository, without having 3 copies of this 1GB data? (actually, when the central repository also update, then there are 4 copies of the same data... can it be reduced? In the SVN scenario, when there are 5 users, then there will be 6GB of data total. With Distributed Version Control, then there will be 12GB of data?)

    Read the article

  • In SQL / MySQL, can a Left Outer Join be used to find out the duplicates when there is no Primary ID

    - by Jian Lin
    I would like to try using Outer Join to find out duplicates in a table: If a table has Primary Index ID, then the following outer join can find out the duplicate names: mysql> select * from gifts; +--------+------------+-----------------+---------------------+ | giftID | name | filename | effectiveTime | +--------+------------+-----------------+---------------------+ | 2 | teddy bear | bear.jpg | 2010-04-24 04:36:03 | | 3 | coffee | coffee123.jpg | 2010-04-24 05:10:43 | | 6 | beer | beer_glass.png | 2010-04-24 05:18:12 | | 10 | heart | heart_shape.jpg | 2010-04-24 05:11:29 | | 11 | ice tea | icetea.jpg | 2010-04-24 05:19:53 | | 12 | cash | cash.png | 2010-04-24 05:27:44 | | 13 | chocolate | choco.jpg | 2010-04-25 04:04:31 | | 14 | coffee | latte.jpg | 2010-04-27 05:49:52 | | 15 | coffee | espresso.jpg | 2010-04-27 06:03:03 | +--------+------------+-----------------+---------------------+ 9 rows in set (0.00 sec) mysql> select * from gifts g1 LEFT JOIN (select * from gifts group by name) g2 on g1.giftID = g2.giftID where g2.giftID IS NULL; +--------+--------+--------------+---------------------+--------+------+----------+---------------+ | giftID | name | filename | effectiveTime | giftID | name | filename | effectiveTime | +--------+--------+--------------+---------------------+--------+------+----------+---------------+ | 14 | coffee | latte.jpg | 2010-04-27 05:49:52 | NULL | NULL | NULL | NULL | | 15 | coffee | espresso.jpg | 2010-04-27 06:03:03 | NULL | NULL | NULL | NULL | +--------+--------+--------------+---------------------+--------+------+----------+---------------+ 2 rows in set (0.00 sec) But what if the table doesn't have a Primary Index ID, then can an outer join still be used to find out duplicates?

    Read the article

  • If Inner Join can be thought of as Cross Join but filtering out the records satisfying the condition

    - by Jian Lin
    If an Inner Join can be thought of as a cross join and then getting the records that satisfy the condition, then a LEFT OUTER JOIN can be thought of as that, plus ONE record on the left table that doesn't satisfy the condition. In other words, it is not a cross join that "goes easy" on the left records (even when the condition is not satisfied), because then the left record can appear many times (as many as how many records there are in the right table). So the LEFT OUTER JOIN is the Cross JOIN with the records satisfying the condition, plus ONE record from the LEFT TABLE that doesn't satisfy the condition.

    Read the article

  • linq-to-sql combine .any expression

    - by Victor
    I need to filter out parent by property value of child collection. I am doing something like this: var results = (from c in db.Customers where c.Orders.Any(o => o.Status = (int)Status.Ordered) select c; It's fine but now I need to filter by 2 values, i.e. take all parent records that have any chilren records that have BOTH values: var results = (from c in db.Customers where c.Orders.Any(o => o.Status == (int)Status.Ordered) && (o.Status == (int).Shipped)) select c; Trying something obvious like this doesn't work.

    Read the article

  • How decompose NSPredicate into components?

    - by Victor
    Is there any common way to decompose an expression created by [NSPredicate predicateWithFormat] to objects NSComprasionPredicate, NSExpression and other? For below example need to disassemble into components. [NSPredicate predicateWithFormat:@"(0 != SUBQUERY(collection, $x, $x.name == "Name").@Count)"];

    Read the article

  • Routing is using ID has action and action has ID after submitting a form

    - by Victor Martins
    I have a model User that has_one user_profile and a User_Profile belongs_to user in the User controller I have: def personal @user = User.find_by_id(params[:id]) @user_profile = @user.user_profile @user_profile ||= @user.build_user_profile end def update_personal @user = User.find_by_id(params[:id]) if @user.user_profile.update_attributes(params[:user_profile]) flash[:notice] = "OK" redirect_to @user else flash[:notice] = "Fail" render :action => 'update_personal' end end In my personal.html.erb view I have: <% semantic_form_for @user_profile, :url => { :action => "update_personal"} do |form| %> <%= form.inputs %> <%= form.buttons %> <%end%> And on the rountes I have: map.resources :users, :member => { :personal => :get, :update_personal => :put } Now the strange thing is that I can do: users/1/personal to see the form but when I submit I get this error: Unknown action No action responded to 1. It's trying to find an action with the name 1. Can anyone point me out on the right direction?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >