Posts

How to display a Rails flash notice upon redirect? -

मेरे पास एक रेल नियंत्रक में निम्नलिखित कोड है: flash.now [: नोटिस ] = चेक_इन_पैथ फिर / चेक_इन दृश्य में: '' सफलतापूर्वक चेक इन '' में चेक किया गया है: & lt; p id = "notice" & gt; & lt;% = नोटिस% & gt; & lt; / p & gt; हालांकि, नोटिस दिखाई नहीं देता। यदि नियंत्रक में रीडायरेक्ट नहीं किया जाता है तो मैं सही काम करता हूं: फ्लैश। अब [: नोटिस] = 'सफलतापूर्वक चेक इन' रेंडर एक्शन: 'चेक_इन' मुझे हालांकि एक रीडायरेक्ट की आवश्यकता है ... न केवल उस क्रिया का प्रतिपादन क्या पुनर्निर्देशन के बाद मेरे पास फ्लैश नोटिस हो सकता है? ".now" निकालें तो बस लिखो: फ्लैश [: नोटिस] = 'चेक_इन_पथ के लिए रीडिंग_ में' सफलतापूर्वक चेक किया गया '। विशेष रूप से जब आप उपयोग करते हैं बस प्रतिपादन और पुनर्निर्देशन नहीं। रीडायरेक्ट करते समय, अब उपयोग नहीं किया जा सकता है।

Rails model as_json overwriting default values -

I am trying to overwrite default model values ​​for JSON, but instead of overwriting it is a duplicate hash My model: class home screen button & lt; ActiveRecord :: Base is_to: product_category Valid: product_category_id ,: x ,: y ,: presence = & gt; Correct attr_accessible: product_category_id, x, y def as_json (option = {}) hash = super (option) hash. Merge ({: product_category_id => "fdfd"}) end My Controller: DIF Index @home_screen_buttons = HomeScreenButton.all response_to do | Format | Format.html # index.html.erb format.json {json: @home_screen_buttons} End End When I open Jason, I show a duplicate for product_category_id: [[ "Created_at": "2013-03-17T11: 14: 32Z", "id": 1, "product_category_id": 5, "updated_at": "2013-03-17T11: 14: 32Z", "X": 300, "Y": 200, "product_category_id": "dfdffff"}] there Hash = [fdfd] hash and

parsing sql statement in haskell -

I am newbie to hackle How to parse the SQL statement "a to b Select where I am referring to the Parsing SQL Statement (value 1, value2, value3, ...), using "hackel You will need the import text to parse this package. Select one from the filename "" for the reader , then case pars p_sql "error message where one (value1, value2, value3, ...)," Left error - & gt; - Handle the correct statement - & gt; - Do something with your predicted SQL statement

javascript - How to write this in a more sophisticated way? -

This works, but I'm sure it's written more clearly. & lt; Script & gt; $ (Document) .ready (function () {$ ('. Col'). CSS ({'height': ($ (document) .height ()) + 'px'}); $ (window) .resize ( Function () {$ ('colonel'). Css ({'height': ($ (document). ()) + 'Px'});})}} gt; I have tried without the first $ ('.cale)' CSS ... and it does not work. So basically what I say to the browser "When the document is ready, resize this div, and resize it at every height change." this Here is: & lt; script & gt; $ (window). Resize (function () {$ ('. Col'). CSS ({'height': ($ (document) ). You can listen to the resize event and when the document is ready (); & lt; / script & gt; If it is done, then it can trigger. Other small changes: You can enter document.ready with $ (function () {}) Resizing event listener can be made before document.ready , becaus...

haskell if exception -

मेरे पास ऐसा कुछ है isLastPermutation (h: t) = पकड़ (nextPermutation H: t)) (\ e- & gt; वापस सही) वापस लौटें कुछ मामलों में अगलाप्रतिष्ठापन एक अपवाद फेंकता है और मैं अपना कार्य चाहते हैं isLastPermutation सही करने के लिए अगर अगलाप्रतिष्ठापन अपवाद अन्यथा गलत है। अन्यथा शुद्ध हास्केल में प्रवाह-नियंत्रण के लिए अपवाद का उपयोग न करें। शायद या या तो का उपयोग करें।

ios - Dealloc an NSObject using ARC -

I have many visual controllers that are with a strong reference to the subclass of NSObject. Each view controller will allow the user to make this object Allows to change in some fashion and then passes the object to the next visual controller. Once the user was able to complete these changes and the process started with a new instance of NSBZ subclass. The problem I am facing is that some view controllers on the stack retain the context of committed examples. I have tried to use weak, and unsafe, but it makes it difficult to pass the object between the view controllers. I basically need an example dealloc of an object once committed, so that the references to any view controllers will be zero. However, ARC does not allow clear calls to dealloc. Can I solve it using NSNotificationCenter or by using a representative, but is there a cleaner way to do this? Any insights will be greatly appreciated thanks! "post-text" itemprop = "text"> Model object (...

xml - Open quote is expected for attribute "android:id" associated with an element type "EditText" -

This is the first time I try to write for the app and I have seen this problem which is more people, but I can not find the answer. It is considered "wrong type", but there is no one in it. Also, all the text boxes are written evenly, but only the first thing has happened. I tried to switch them but only before Only it was received. & lt; XML version = "1.0" encoding = "utf-8"> EditText android: id = @ + id / editText2 Android: layout_width = "Wrap_content" android: layout_height = "wrap_content" android: EMS = "10" Android: inputType = "numberSigned" Android: width = "1DP" & gt; & Lt; RequestFocus / & gt; & Lt; / Edittext & gt; & Lt; Edit text Android: id = @ + id / edittext3android: layout_width = "wra p_content" android: layout_height = "wrap_content" android: EMS = "10" Android: inputType = "numberSigned" Android: width = ...