Search Results

Search found 5637 results on 226 pages for 'triple slash comments'.

Page 16/226 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Rails 3 Form For Custom Action

    - by Andrew
    I'm having trouble routing a form to a custom action in Rails 3. Here are my routes: resources :photos do resources :comments collection do get 'update_states' end member do put 'upload' end end Here's the form_for: form_for @photo, :remote => true, :url => { :action => upload_photo_path(@photo) }, :html => { :multipart => :true, :method => 'put' } do |f| And here's the error message: No route matches {:action=>"/photos/42/upload", :controller=>"photos"} ... this is especially frustrating because "photos/:id/upload" is exactly the correct action for this form. What am I missing? EDITS - Here are the original Photo-related routes: photo_comments GET /photos/:photo_id/comments(.:format) {:action=>"index", :controller=>"comments"} POST /photos/:photo_id/comments(.:format) {:action=>"create", :controller=>"comments"} new_photo_comment GET /photos/:photo_id/comments/new(.:format) {:action=>"new", :controller=>"comments"} edit_photo_comment GET /photos/:photo_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"} photo_comment GET /photos/:photo_id/comments/:id(.:format) {:action=>"show", :controller=>"comments"} PUT /photos/:photo_id/comments/:id(.:format) {:action=>"update", :controller=>"comments"} DELETE /photos/:photo_id/comments/:id(.:format) {:action=>"destroy", :controller=>"comments"} update_states_photos GET /photos/update_states(.:format) {:action=>"update_states", :controller=>"photos"} upload_photo PUT /photos/:id/upload(.:format) {:action=>"upload", :controller=>"photos"} photos GET /photos(.:format) {:action=>"index", :controller=>"photos"} POST /photos(.:format) {:action=>"create", :controller=>"photos"} new_photo GET /photos/new(.:format) {:action=>"new", :controller=>"photos"} edit_photo GET /photos/:id/edit(.:format) {:action=>"edit", :controller=>"photos"} photo GET /photos/:id(.:format) {:action=>"show", :controller=>"photos"} PUT /photos/:id(.:format) {:action=>"update", :controller=>"photos"} DELETE /photos/:id(.:format) {:action=>"destroy", :controller=>"photos"} Here are the relevant routes when I changed the route to match 'upload': photo_comments GET /photos/:photo_id/comments(.:format) {:action=>"index", :controller=>"comments"} POST /photos/:photo_id/comments(.:format) {:action=>"create", :controller=>"comments"} } new_photo_comment GET /photos/:photo_id/comments/new(.:format) {:action=>"new", :controller=>"comments"} edit_photo_comment GET /photos/:photo_id/comments/:id/edit(.:format) {:action=>"edit", :controller=>"comments"} photo_comment GET /photos/:photo_id/comments/:id(.:format) {:action=>"show", :controller=>"comments"} PUT /photos/:photo_id/comments/:id(.:format) {:action=>"update", :controller=>"comments"} DELETE /photos/:photo_id/comments/:id(.:format) {:action=>"destroy", :controller=>"comments"} update_states_photos GET /photos/update_states(.:format) {:action=>"update_states", :controller=>"photos"} upload_photo /photos/:id/upload(.:format) {:action=>"upload", :controller=>"photos"} photos GET /photos(.:format) {:action=>"index", :controller=>"photos"} POST /photos(.:format) {:action=>"create", :controller=>"photos"} new_photo GET /photos/new(.:format) {:action=>"new", :controller=>"photos"} edit_photo GET /photos/:id/edit(.:format) {:action=>"edit", :controller=>"photos"} photo GET /photos/:id(.:format) {:action=>"show", :controller=>"photos"} PUT /photos/:id(.:format) {:action=>"update", :controller=>"photos"} DELETE /photos/:id(.:format) {:action=>"destroy", :controller=>"photos"} Unfortunately 'match' didn't work any better... -- EDIT -- Just to confirm another scenario here... with this in the routes: resources :photos do resources :comments collection do get 'update_states' end member do match 'upload' end end and this in the view: form_for @photo, :remote => true, :url => { :action => 'upload' }, :html => { :multipart => :true, :id => 'photo_upload' } do |f| I still get: No route matches {:action=>"upload", :controller=>"photos"}

    Read the article

  • FB.Event.subscribe + comments.add don't work !?

    - by user366292
    I'm trying to catch event when comment is sent. What am I doing wrong? I just want to update every user comment also to facebook group wall and that's why I need to catch the event. <fb:comments numposts="10" ></fb:comments> FB.init and event catcher: <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ appId : 'sensored-app-id', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); /* All the events registered */ FB.Event.subscribe('comments.add', function (response) { // do something with response alert("comment added"); }); }; (function() { var e = document.createElement('script'); e.src = document.location.protocol + '//connect.facebook.net/fi_FI/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); </script>

    Read the article

  • Microsoft Word Macro - Exporting Word Review Comments - How do you reference the sentence related to

    - by jspeaks
    I am trying to export of a Word document review comments. I want to export the sentence selection that was commented on followed by the comment. Screen shot of the image: http://jspeaks.com/mswordcomment.png I have found code to loop through the document comments, but I cannot figure out how to reference the sentence selection that the comment was related to. The current logic is: Sub ExportComments() Dim s As String Dim cmt As Word.Comment Dim doc As Word.Document For Each cmt In ActiveDocument.Comments s = s & cmt.Initial & cmt.Index & "," & cmt.Range.Text & vbCr Next Set doc = Documents.Add doc.Range.Text = s End Sub I tinkered with Selection.Range, however I cannot determine the proper object or property that contains the referenced sentence. I would like to produce output like the follow (if we use the example in picture above): Sentence: Here are more sentences that contain interesting facts - Comment: This is an interesting fact. Sentence: Here are more sentences that contain interesting facts. Here are more sentences that contain interesting facts. - Comment: This is a very interesting fact

    Read the article

  • Reverse ordered list for jquery submitted comments

    - by g-man
    Hey guys I have one more question lol. I am using a script that allows users to submit comments through jquery ajax, however when they are submitted, the submitted comments submit at the bottom of the other comments which are sorted in descending order (newest on top) when the page first loads (due to mysql query). Is there a way to make it submit on top through some sort of sorting javascript function? function prepare(response) { var d = new Date(); count++; d.setTime(response.time*1000); var mytime = d.getHours()+':'+d.getMinutes()+':'+d.getSeconds(); var string = '<li class="shoutbox-list" id="list-'+count+'">' + '<span class="date">'+mytime+'</span>' + '<span class="shoutbox-list-nick"><a href="statistics.php?user='+response.user+'">'+response.user+'</a>:</span>' + '<span class="msg">'+response.message+'</span>' +'</li>'; return string; } function success(response, status) { if(status == 'success') { lastTime = response.time; $('#daddy-shoutbox-list').append(prepare(response)); $('input[name=message]').attr('value', '').focus(); $('#list-'+count).fadeIn('slow'); timeoutID = setTimeout(refresh, 3000); } } <div id="daddy-shoutbox"> <ol id="daddy-shoutbox-list"></ol> </div>

    Read the article

  • Unobtrusive, self-hosted comments function to put onto existing web pages

    - by Pekka
    I am building a new site which will consist of a mix of dynamic and static pages. I would like to add commenting functionality to those pages with as little work as possible. I'm curious as to whether such a solution exists in PHP. The ideal set of features would be: Completely independent from the surrounding page / site: PHP code gets dropped into page, a page ID is added, done. Simple "write a comment" form Comments for each page are displayed using a PHP function Nice, clean output of <ul><li>.... that can be styled by the surrounding site Optional Captcha Optional Gravatar sensitivity Minimalistic administration area to moderate/delete comments, no ACL, can protect it using .htaccess The ideal integreation would be like this: <?php show_comments("my_page_name"); ?> this would 1. display a form to add a new comment that gets automatically associtated with my_page_name; and 2. display all comments that were made through this form using this ID. Does anybody know a solution like this? Bounty I am setting up a bounty because while there were some good suggestions, they all point to external services. I'm really curious to see whether there isn't anything self-hosted around. If this doesn't exist yet, it sure would be great to see as an Open Source project.

    Read the article

  • Rails - embedded polymorphic comment list + add comment form - example?

    - by odigity
    Hey, all. Working on my first Rails app. I've searched all around - read a bunch of tutorials, articles, and forum posts, watched some screencasts, and I've found a few examples that come close to what I'm trying to do (notably http://railscasts.com/episodes/154-polymorphic-association and ep 196 about nested model forms), but not exactly. I have two models (Podcast and BlogPost) that need to be commentable, and I have a Comment model that is polymorphically related to both. The railscasts above had a very similar example (ep 154), but Ryan used a full set of nested routes, so there were specific templates for adding and editing comments. What I want to do is show the list of comments right on the Podcast or BlogPost page, along with an Add Comment form at the bottom. I don't need a separate add template/route, and I don't need the ability to edit, only delete. This is a pretty common design on the web, but I can't find a Rails example specifically about this pattern. Here's my current understanding: I need routes for the create and delete actions, of course, but there are no templates associated with those. I'm also guessing that the right approach is to create a partial that can be included at the bottom of both the Podcast and BlogPost show template. The logical name for the partial seems to me to be something like _comments.html.haml. I know it's a common convention to have the object passed to the partial be named after the template, but calling the object 'comments' seems to not match my use case, since what I really need to pass is the commentable object (Podcast or BlogPost). So, I guess I'd use the locals option for the render partial call? (:commentable = @podcast). Inside the partial, I could call commentable.comments to get the comments collection, render that with a second partial (this time with the conventional use case, calling the partial _comment.html.haml), then create a form that submits to... what? REST-wise, it should be a POST to the collection, which would be /podcast|blogpost/:id/comments, and I think the helper for that is podcast_comments_path(podcast) if it were a podcast - not sure what to do though, since I'm using polymorphic comments. That would trigger the Comment.create action, which would then need to redirect back to the podcast|blogpost path /podcast|blogpost/:id. It's all a bit overwhelming, which is why I was really hoping to find a screencast or example that specifically implements this design.

    Read the article

  • Whats wrong with my triple DES wrapper??

    - by Chen Kinnrot
    it seems that my code adds 6 bytes to the result file after encrypt decrypt is called.. i tries it on a mkv file.. please help here is my code class TripleDESCryptoService : IEncryptor, IDecryptor { public void Encrypt(string inputFileName, string outputFileName, string key) { EncryptFile(inputFileName, outputFileName, key); } public void Decrypt(string inputFileName, string outputFileName, string key) { DecryptFile(inputFileName, outputFileName, key); } static void EncryptFile(string inputFileName, string outputFileName, string sKey) { var outFile = new FileStream(outputFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite); // The chryptographic service provider we're going to use var cryptoAlgorithm = new TripleDESCryptoServiceProvider(); SetKeys(cryptoAlgorithm, sKey); // This object links data streams to cryptographic values var cryptoStream = new CryptoStream(outFile, cryptoAlgorithm.CreateEncryptor(), CryptoStreamMode.Write); // This stream writer will write the new file var encryptionStream = new BinaryWriter(cryptoStream); // This stream reader will read the file to encrypt var inFile = new FileStream(inputFileName, FileMode.Open, FileAccess.Read); var readwe = new BinaryReader(inFile); // Loop through the file to encrypt, line by line var date = readwe.ReadBytes((int)readwe.BaseStream.Length); // Write to the encryption stream encryptionStream.Write(date); // Wrap things up inFile.Close(); encryptionStream.Flush(); encryptionStream.Close(); } private static void SetKeys(SymmetricAlgorithm algorithm, string key) { var keyAsBytes = Encoding.ASCII.GetBytes(key); algorithm.IV = keyAsBytes.Take(algorithm.IV.Length).ToArray(); algorithm.Key = keyAsBytes.Take(algorithm.Key.Length).ToArray(); } static void DecryptFile(string inputFilename, string outputFilename, string sKey) { // The encrypted file var inFile = File.OpenRead(inputFilename); // The decrypted file var outFile = new FileStream(outputFilename, FileMode.OpenOrCreate, FileAccess.ReadWrite); // Prepare the encryption algorithm and read the key from the key file var cryptAlgorithm = new TripleDESCryptoServiceProvider(); SetKeys(cryptAlgorithm, sKey); // The cryptographic stream takes in the encrypted file var encryptionStream = new CryptoStream(inFile, cryptAlgorithm.CreateDecryptor(), CryptoStreamMode.Read); // Write the new unecrypted file var cleanStreamReader = new BinaryReader(encryptionStream); var cleanStreamWriter = new BinaryWriter(outFile); cleanStreamWriter.Write(cleanStreamReader.ReadBytes((int)inFile.Length)); cleanStreamWriter.Close(); outFile.Close(); cleanStreamReader.Close(); } }

    Read the article

  • forward slash problem in xsl ams xsql

    - by Peter Kaleta
    Hi I have simple xsql <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="zad1.xsl" ?> <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/mondialDS"> <xsql:query max-rows="-1" null-indicator="no" tag-case="lower" rowset-element="continents"> select name as continent from mondial_user.Continent order by 1 </xsql:query> </page> which gives me a list of continents with "australia/oceania" among them i use XSL on above xsql : <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- Root template --> <res> <xsl:template match="/continents"> <xsl:for-each select="row"> <re> <xsl:value-of select="continent"/> </re> </xsl:for-each> </xsl:template> </res> </xsl:stylesheet> ANd firefox throws error : on wrong formated xml document with : AfricaAmericaAsiaAustralia/OceaniaEurope -----------------------------------^ Help apreciated

    Read the article

  • Initialization vector - DES/triple-des algorithm

    - by user312373
    Hi, In order to generate the encrypted data we would need to define a Key that should suffice generating the data. But in .net DESCryptoServiceProvider requires Key and Intialisation Vector to generate the encrypted data. In this regard, I would like to know the importance & the benefit gained by defining this initialisation vector field. Is this mandatory while encryption using DES algorithm. Pls share your thoughts on the same. Regards, Balu

    Read the article

  • nginx trailing slash issues

    - by ry
    I'm googling a lot and found several workarounds, but you have to deinfe every single directory. On Apache: example.com/hi - example.com/hi/ On nginx: example.com/hi - Firefox can't establish a connection to the server at example.com:8888 where 8888 is what Apache is listening on (nginx's :80 - localhost:8888) Any ideas how to fix this and have it just forward normally like folder?

    Read the article

  • Forward slash problem in xsl and xsql

    - by Peter Kaleta
    Hi I have simple xsql <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="zad1.xsl" ?> <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/mondialDS"> <xsql:query max-rows="-1" null-indicator="no" tag-case="lower" rowset-element="continents"> select name as continent from mondial_user.Continent order by 1 </xsql:query> </page> which gives me a list of continents with "australia/oceania" among them i use XSL on above xsql : <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- Root template --> <res> <xsl:template match="/continents"> <xsl:for-each select="row"> <re> <xsl:value-of select="continent"/> </re> </xsl:for-each> </xsl:template> </res> </xsl:stylesheet> Firefox throws an error on "wrong formated xml document" with: AfricaAmericaAsiaAustralia/OceaniaEurope -----------------------------------^ Help appreciated.

    Read the article

  • htaccess - Redirects with more than 1 slash not working

    - by barfoon
    Hey everyone, Just moved to shared hosting on GoDaddy and Im trying to get my .htaccess rules working. Heres what I have: ErrorDocument 404 /error.php Options FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.mydomain\.org$ RewriteRule ^(.*)$ http://mydomain.org/$1 [R=301,L] RewriteRule ^view/(\w+)$ viewitem.php?itemid=$1 [R=301,L] RewriteRule ^category/(\w+)$ viewcategory.php?tag=$1 [R=301,L] RewriteRule ^faq$ faq.php RewriteRule ^about$ about.php RewriteRule ^contact$ contact.php RewriteRule ^submit$ submit.php RewriteRule ^contactmsg$ handler-contact.php All the pages @ the root of the domain seem to be working i.e mydomain.org/faq, mydomain.org/about are working. But whenever I try mydomain.org/category/somecategory, I get a 404. How can I fix my .htaccess to obey these rules that are more than 1 level deep? Thanks,

    Read the article

  • Mod_rewrite and redirects with training forward slash not working

    - by john williams
    I'm using the following lines of code in my .htaccess file to create redirects. The problem is, whenever I go to example.com/register/ it cant find the css files because it's looking for example.com/register/mycss.css instead of example.com/mycss.css. Redirect 301 register.php http://example.com/register RewriteRule ^register/?$ register.php How can I correct this? I'm new to any kind of htaccess/mod_rewrite functions so feel free to point me in the right direction if there are any other flaws.

    Read the article

  • Why this button doesn't cause triple postback?

    - by focus
    We have developed a page with a asp.net and debugging it accidentally we have discovered on our page button with the next code on onclik attribute onclick="__doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton',''); __doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$FormPlace$m_userTaskMarkAsUnreadButton", "", true, "", "", false, false))" It seems that the button do three postbacks but when we click it only cause on postback. With this code seems that de button will cause three postbacks!! We have try it with Internet Explorer and Firefox and the button only cause on postback always. Are browsers who avoid that the button do three postback ? Or Is Asp.net server who avoid the three postback? We don't understand why the button behaves correctly if onclick attribute has three call to do Postbacks. Thanks

    Read the article

  • Python what's the data structure for triple data

    - by Paul
    I've got a set of data that has three attributes, say A, B, and C, where A is kind of the index (i.e., A is used to look up the other two attributes.) What would be the best data structure for such data? I used two dictionaries, with A as the index of each. However, there's key errors when the query to the data doesn't match any instance of A.

    Read the article

  • how to prevent database to add slash to quotes

    - by black sensei
    i know this sounds really common and so trivial but , am having a challenge here. I have a web site with Zend/Doctrine and i use ckeditor for the backend management. after uploading the site i've realized that during edit testing the look and feel of the site is messed up. with the help of firebug, i've seen that there are slashes all over the html. after inline edition, the look and feel came back to normal. There are so many files , i can't think of doing other decoding before outputting data from mysql. What options do i have to solve this problem. the site is up already and i feel a bit unconfortable about this. Can anyone give a hint? thanks

    Read the article

  • "slash before every quote" problem

    - by Camran
    I have a php page which contains a form. Sometimes this page is submitted to itself (like when pics are uploaded). I wouldn't want users to have to fill in every field again and again, so I use this as a value of a text-input inside the form: value="<?php echo htmlentities(@$_POST['annonsera_headline'],ENT_COMPAT,'UTF-8');?>"> This works, except it adds a "\" sign before every double-quote... For instance writing 19" wheels gives after page is submitted to itself: 19\" wheels And if I don't even use htmlentities then everything after the quotes dissappears. What is the problem here?

    Read the article

  • URL structure preference - to slash or not to slash?

    - by TheDeadMedic
    I'm using custom post types in WordPress 3.0 to manage 'courses' (or seminars, lectures, whatever term you'd prefer to have in mind). Now for viewing a single 'course', the url structure is; /course/course-name/ But for multiple courses? /courses/category/category-name/ Or... /course-category/category-name/ Or something entirely different?

    Read the article

  • removing forward slash in .htaccess

    - by user1083644
    I am using Jobbersbase for my online job portal. In which i have given link to my main webpage page like this http://www.mydomain.com/aboutus.html, but its not working because the link is taking '/' at the end http://www.mydomain.com/aboutus.html/ I tried adding RewriteCond %{REQUEST_FILENAME}\.html -f in .htaccess , if i add that other links doesnt work which has / for example http://www.mydomain.com/jobs/ Now my .htaccess looks like this # AddType x-mapp-php5 .php # AddHandler x-mapp-php5 .php RewriteEngine On RewriteCond %{REQUEST_URI} .*/$ RewriteRule (.*)/$ $1 ErrorDocument 404 /page-unavailable/ <files ~ "\.tpl$"> order deny,allow allow from none deny from all </files> Someone please suggest me how to do it thanks

    Read the article

  • Is a code review which uses only code comments a good idea?

    - by gaRex
    Preconditions Team uses DVCS IDE supports comments parsing (like TODO and etc.) Tools like CodeCollaborator are expensive for budget Tools like gerrit are too complex for install or not usable Workflow Author publishes somewhere on central repo feature branch Reviewer fetch it and start review In case of some question/issue reviewer create comment with special label, like "REV". Such label MUST not be in production code -- only on review stage: $somevar = 123; // REV Why do echo this here? echo $somevar; When reviewer finish post comments -- it just commits with stupid message "comments" and pushes back Author pulls feature branch back and answer comments in similar way or improve code and push it back When "REV" comments have gone we can think, that review has successfully finished. Author interactively rebases feature branch, squashes it to remove those "comment" commits and now is ready to merge feature to develop or make any action that usualy could be after successful internal review IDE support I know, that custom comment tags are possible in eclipse & netbeans. Sure it also should be in blablaStorm family. Questions Do you think this methodology is viable? Do you know something similar? What can be improved in it?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >