Search Results

Search found 884 results on 36 pages for 'acts as taggable on'.

Page 2/36 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Using include() to load different page content acts differently locally vs hosted

    - by hookedonwinter
    I have a live site that includes different php files depending on what page the user is trying to access. The header and footer are the same, but in the file, if the user requests filename1.php vs filename2.php, a different php is loaded into the content of the page. Basic CMS stuff. On the live site, it works fine. I just set up a local dev environment, and it doesn't work. The file that is supposed to load into the middle of the page instead is the only file loaded. I'm not saying this well. Here's an example: How it works live: <html> <head> Stuff </head> <body> More stuff <? include( 'some_file.php' ); ?> </body> </html> How it works locally: <? include( 'some_file.php' ); ?> Just that file loads, no other content. Any thoughts on why that one page is loading, but not the surrounding content? If I'm not explaining this well, please let me know.

    Read the article

  • AS2 acts randomly when changing scenes on the first frame

    - by fabieno
    I have a flash movie containing to scenes: scene1, scene2. I have chosen the order so that scene1 starts first, I was requested to add a functionality to allow flashvars to be passed, if fv_change equals one then scene2 should be the first to appear when the movie is loaded. I have included the following code in scene1 first frame of some layer: this.onEnterFrame = function() { delete this.onEnterFrame; if (isset==undefined && _root.fv_change && _root.fv_change==1) { isset = true; gotoAndStop("scene2",1); } } when testing in my flash environment everything worked fine, when I exported it to an HTML & SWF combo I got random results, I refreshed the page several times and some of the times scene2 appeared and some of the times it stayed with scene1. Am I doing something wrong? what is the correct way to change scene order using AS2 and external data(flashvars for that matter).

    Read the article

  • echo -e acts differently when run in a script by root on ubuntu

    - by ekrub
    When running a bash script on ubuntu 9.10, I get different behavior from bash echo's "-e" option depending on whether or not I'm running as root. Consider this script: $ cat echo-test if [ "`whoami`" = "root" ]; then echo "Running as root" fi echo Testing /bin/echo -e /bin/echo -e "foo\nbar" echo Testing bash echo -e echo -e "foo\nbar" When run as non-root user, I see this output: $ ./echo-test Testing /bin/echo -e foo bar Testing bash echo -e foo bar When run as root, I see this output: $ sudo ./echo-test Running as root Testing /bin/echo -e foo bar Testing bash echo -e -e foo bar Notice the "-e" being echoed in the last case ("-e foo" instead of "foo" on the second-to-last line). When running a script as root, the echo command runs as if "-e" was given and, if -e is given, the option itself is echoed. I can understand some subtle differences in behavior between /bin/echo and bash echo, but I would expect bash echo to behave the same no matter which user invokes it. Anyone know why this is the case? Is this a bug in bash echo? FYI -- I'm running GNU bash, version 4.0.33(1)-release (x86_64-pc-linux-gnu)

    Read the article

  • UIWebView goBack method acts differently on different devices

    - by maxpower
    First Device: 8gb 2nd gen Version: 3.1.3 (7E18) Model: MB528LL Second Device: 32gb 3rd gen Version: 3.1.3 (7E18) Model: MC008LL When I call goBack on the 8gb device, shouldStartLoadWithRequest:navigationType: is called When I call goBack on the 32gb device, shouldStartLoadWithRequest:navigationType: is not called I am not doing any caching (not like it works anyway). To make sure it wasn't caching I removed any possible caching via the request object's cache policy and removing all cache whenever webViewDidFinishLoading is called. Same app, same url, everything is the same but the device itself. Why? FYI: shouldStartLoadWithRequest:navigationType: is called on the simulator when goBack is called

    Read the article

  • testing directory S_ISDIR acts inconsistently

    - by coubeatczech
    hi, I'm doing simple tests on all files in directory. But from some reason, sometimes, they behave wrongly? What's bad with my code? using namespace std; int main() { string s = "/home/"; struct dirent * file; DIR * dir = opendir(s.c_str()); while ((file = readdir(dir)) != NULL){ struct stat * file_info = new (struct stat); stat(file-d_name,file_info); if ((file_info-st_mode & S_IFMT) == S_IFDIR) cout << "dir" << endl; else cout << "other" << endl; } closedir(dir); }

    Read the article

  • List Component that acts as if control was permanently pressed

    - by Dennkster
    Hey, I have a list control and i want the user to be able to select many items at a time. Thus I want it to act that if the control key is pressed while he is clicking. Eg if he clicks on a selected row it should become unselected and if he clicks on a unselected row it should become selected. Do you have any idea how to do this? Thanks, Dennis

    Read the article

  • How to pass a Context when using acts_as_taggable_on for assigning tags

    - by kbjerring
    I am using acts_as_taggable_on for assigning 'fixed' categories as well as free' tags to a Company model. My question is how I can pass the correct tag Context for the two different kinds of tags in the form view. For instance, I would like the user to click all the "sector" categories that apply to a company, and then be freely allowed to add additional tags. At this point, the only way I have gotten this to work is through the company model (inspired by this question): # models/company.rb class Company ... acts_as_taggable_on :sectors, :tags has_many :sector_tags, :through => :taggings, :source => :tag, has_many :taggings, :as => :taggable, :include => :tag, :class_name => "ActsAsTaggableOn::Tagging", :conditions => { :taggable_type => "Company", :context => "sectors" } ... end in the form (using the simple_form gem) I have... # views/companies/_form.html.haml = simple_form_for @company do |f| = f.input :name = f.association :sector_tags, :as => :check_boxes, :hint => "Please click all that apply" = f.input :tag_list But this obviously causes the two tag types ("sectors" and "tags") to be of the same "sectors" context which is not what I want. Can anyone hint at how I can pass the relevant Context ("sectors") in the form where the user assigns the sector tags? Or maybe I can pass it in the "has_many :sector_tags ..." line in the Company model? A related question is if this is a good way to do it at all? Would I be better off just using a Category model for assigning sector tags through a joint model? Thanks!

    Read the article

  • Rails 3 / RVM - Acts_as_list compiled locally - Why Can't Ruby See This Gem?

    - by rabbit on rails
    I cannot figure out why rails/ruby cannot see this gem, despite each telling me that the gem is visible. I compiled this gem locally from a github branch since the main version seems to be broken in Rails 3. Or perhaps I am missing something else entirely. Ovid:lightserve dlipa$ gem list *** LOCAL GEMS *** .. acts_as_list (0.2.1) .. And Ovid:lightserve dlipa$ cat Gemfile ... gem "acts_as_list", "0.2.1" ... And Ovid:lightserve dlipa$ bundle install ... Using acts_as_list (0.2.1) Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed But Ovid:lightserve dlipa$ r c RubyGems Environment: - RUBYGEMS VERSION: 1.6.1 - RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [x86_64-darwin10.6.0] - INSTALLATION DIRECTORY: /Users/dlipa/.rvm/gems/ruby-1.9.2-p180 - RUBY EXECUTABLE: /Users/dlipa/.rvm/rubies/ruby-1.9.2-p180/bin/ruby - EXECUTABLE DIRECTORY: /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/bin - RUBYGEMS PLATFORMS: - ruby - x86_64-darwin-10 - GEM PATHS: - /Users/dlipa/.rvm/gems/ruby-1.9.2-p180 - /Users/dlipa/.rvm/gems/ruby-1.9.2-p180@global - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - :sources => ["http://rubygems.org/", "http://gems.github.com"] - REMOTE SOURCES: - http://rubygems.org/ - http://gems.github.com Loading development environment (Rails 3.0.5) ruby-1.9.2-p180 :001 > require 'acts_as_list' LoadError: no such file to load -- acts_as_list from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `block in require' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `block in load_dependency' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require' from (irb):1 from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/console.rb:44:in `start' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands/console.rb:8:in `start' from /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:23:in `<top (required)>' from script/rails:6:in `require' from script/rails:6:in `<main>' ruby-1.9.2-p180 :002 > And Ovid:lightserve dlipa$ irb ruby-1.9.2-p180 :001 > require 'acts_as_list' LoadError: no such file to load -- acts_as_list from /Users/dlipa/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/dlipa/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from (irb):1 from /Users/dlipa/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>' ruby-1.9.2-p180 :002 > Can anyone explain why this might be happening? I'd really appreciate it! ** UPDATE -- Response to Andrew Marshall's suggestion** I changed Gemfile to read the gem directly from git, but it did not resolve the problem. Does this mean that there is a problem with this gem? The error message is not very helpful ;-) Removed: Ovid:lightserve dlipa$ bundle show acts_as_list Could not find gem 'acts_as_list' in the current bundle. Then added back via: gem "acts_as_list", :git => "git://github.com/vpereira/acts_as_list.git" Ovid:lightserve dlipa$ bundle install Updating git://github.com/vpereira/acts_as_list.git ... Same problem even though bundle show matches the commit on that page: Ovid:lightserve dlipa$ bundle show acts_as_list /Users/dlipa/.rvm/gems/ruby-1.9.2-p180/bundler/gems/acts_as_list-4cb76a8b198c Ovid:lightserve dlipa$ irb ruby-1.9.2-p180 :001 > require 'acts_as_list' LoadError: no such file to load -- acts_as_list from /Users/dlipa/.rvm/rubies/ruby-1.9.2-.. I just looked in the gem and it appears there is no file called 'acts_as_list' in the gem. So it appears to be idiosyncratic, albeit poorly reported by Rails/Ruby. The API appears to have changed to: ruby-1.9.2-p180 :003 > require 'active_record/acts/list' => nil ruby-1.9.2-p180 :004 > ActiveRecord::Acts::List => ActiveRecord::Acts::List

    Read the article

  • Thinking Sphinx and acts_as_taggable_on plugin

    - by Brian Roisentul
    Hi, I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category.name, :as => :category has category(:id), :as => :category_ids has tags(:id), :as => :tag_ids end For some reason, when I run the following command, it will bring just one announcement, that has nothing to do with what I expect. I've got many announcements, so I expected a lot of results instead. Announcement.search params[:announcement][:search].to_s, :with => {:tag_ids => 1}, :page => params[:page], :per_page => 10 I guess something is wrong, and it's not searching correctly. Can anyone give my a clue of what's going on? Thanks, Brian

    Read the article

  • Rail plugin acts_as_taggable_on :through

    - by Craig
    I have two models: class Employee < ActiveRecord::Base has_many :projects end class Project < ActiveRecord::Base acts_as_taggable_on :skills, :roles end I would like to find Employees using the tags associated with their projects. The geokit-rails plugin supports a similar concept, using its ':through' relationship. Ideally, I would be able to: specify which tags (i.e. skills, roles) would be included in the conditions order the employees by the total number of projects with matching tags be able to access the matching-tag count for each employee for the purposes of building a tag cloud Any thoughts would be appreciated.

    Read the article

  • Rails acts_as_taggable_on grouped alphabetically?

    - by Ray Dookie
    Having sorted the tag_counts hash via the following code: sorted_tags = Contact.tag_counts.sort{ |x,y| x.name.downcase <= y.name.downcase } what is the easiest/most efficient way to display the tags in my view grouped by letters? i.e A - "Alpha", "Apple", "Aza" B - "Beta", "Bonkers" . . . Z - "Zeta", "Zimmer" Any ideas?

    Read the article

  • acts_as_taggable_on and auto_complete returning no results

    - by Sean Johnson
    I'm using acts_as_taggable_on in a model, and am trying to implement the auto_complete plugin. It seems as though I have everything hooked up correctly, but the search isn't returning any results. Here's what I have so far: In the view: <%= text_field_with_auto_complete(:link, :tag_list, {}, {:tokens => ','}) %> In the controller: def auto_complete_for_link_tag_list @tags = Link.tag_counts_on(:tags).where('tags.name LIKE ?', params[:link][:tag_list]) render :inline => "<%= auto_complete_result(@tags, 'name') %>", :layout => false logger.info "#{@tags.size} tags found." end The logger keeps returning 0 tags, and nothing shows up in the view (yeah, the layout includes the javascript defaults). Any thoughts or advice would be awesome.

    Read the article

  • Rails (pagination and tags)

    - by Vitaly
    Hey, I stumbled upon a problem of how to mix both acts_as_taggable (on steroids) and will_paginate gems. What I found on this problem is this: http://www.mckinneystation.com/2007/08/20/pagination-with-acts_as_taggable_on_steroids-acts_as_ferret-and-will_paginate/ But it's dated of 2007, may be there's something more recent? And also could you explain in details what should I do to make that fix work?

    Read the article

  • Suggestions on how to track tag count for a particular object

    - by Robin Fisher
    Hi, I'm looking for suggestions on how to track the number of tags associated with a particular object in Rails. I'm using acts_as_taggable_on and it's working fine. What I would like to be able to do is search for all objects that have no tags, preferably through a scope i.e. Object.untagged.all My first thought was to use an after_save callback to update an attribute called "taggings_count" in my model: def update_taggings_count self.taggings_count = self.tag_list.size self.save end Unfortunately, this does the obvious thing of putting me in an infinite loop. I need to use an after_save callback because the tag_list is not updated until the main object is saved. Would appreciate any suggestions as I'm on the verge of rolling my own tagging system. Regards Robin

    Read the article

  • Stable URL of acts_as_taggable plugin in Ruby on Rails

    - by Rakesh Gupta
    Hi, In one of my applications on Ruby on Rails, I am using acts_as_taggable plugin. Coding was doing fine and suddenly it started giving following error. RuntimeError (acts_as_taggable_on_steroids has been moved to github: http://github.com/jviney/acts_as_taggable_on_steroids): app/models/post.rb:2 app/controllers/post_controller.rb:324:in post_scoper' app/controllers/post_controller.rb:221:indefault' C:\MyApp\script\server:3 -e:2:in `load' -e:2 Rendered rescues/_trace (94.0ms) Rendered rescues/_request_and_response (15.0ms) Rendering rescues/layout (internal_server_error) When trying installing the plugin from above URL, it says plugin has been moved. Does anyone have idea, what is the stable URL of acts_as_taggable plugin? Thanks in advance

    Read the article

  • Rails: Can't set or update tag_list using a text field with acts_as_taggable_on

    - by Josh
    Hey everyone, I'm trying to add tagging to a rails photo gallery system I'm working on. It works from the back-end, but if I try to set or change it in the form view, it doesn't work. I added acts_as_taggable to the photo model and did the migrations. My gallery builder is programmed to add one tag automatically to each photo it creates. This works fine, just as if it were setting it for the console. However, I can't seem to set tags using a text_field in the photo form. Here's the code I added to my photo form: <p> <%= f.label :tag_list %><br /> <%= f.text_field :tag_list %> </p> Now, that's pretty trivial, and since :tag_list supports single-string comma-separated assignment (e.g. tag_list = "this, that, the other" #= ['this', 'that', 'the other']), I don't see why using a text field doesn't work. And to make even less sense, if a tag list has already been populated, the list will still show up in the text field when editing the photo. I just can't seem to commit any changes to the list. The documentation on their github page doesn't appear to give any information on how to set these values from the view. Any ideas? Oh, and I'm using the Rails 3 gem version.

    Read the article

  • Model's method not being recognized when called

    - by Brian Roisentul
    I'm using ruby on rails 2.3.2 and also using the acts_as_taggable_on puglin. That generated me two db tables: tags and taggings. As I didn't need anything more from those, I didn't create a Tag model, for example. Now the project is more mature, I need to create some methods for tags, so I created a Tag model with some methods in it. The model looks something like this: class Tag < ActiveRecord::Base def self.get_parent parent = Tag.find(self.parent_id) return parent end end When I call it from a controller, it won't find the method. This is the code: tag = Tag.find(tag_id) the_parent = tag.get_parent This will throw an error saying: undefined method `get_parent' for #<Tag id: 13, name: "Historia", parent_id: 12> I don't know what's wrong. Any help will be appreciated.

    Read the article

  • How can I use form_remote_tag to update an acts_as_taggable_on field?

    - by Angela
    I have a model called Company which is acts_as_taggable_on. When I am /SHOWing a Company (e.g. company/15) I want to be able to see a form that allows me to add tags. I suppose this would be easier by just allowing at edit but sometimes I want to go back and just add tags. This is what I tried to do and I get an error: <div id = 'tags'> <strong>Tags:</strong> <% form_remote_tag(:url => {:action => 'update'}, :update => 'tags') do %> <%= text_field :company, :tag_list %> <%= submit_tag 'Save' %> <% end %> </div> Thanks!

    Read the article

  • Find and sort by number of ocurrences of tag with Active Admin and act_as_taggable_on

    - by nunopolonia
    I'm using act_as_taggable_on and Active Admin on a Rails project. In that project there are Posts and each Post has Tags. I want to show a list of Tags in Active Admin and the number of ocurrences of each one. The way I found to do this was: index do column :name column :ocurrences do |tag| ocurrences = Post.tag_counts.find(tag.id).count end default_actions end Which will search the Tag List every time for every Post, which performance wise looks really bad. I would also like to be able to sort the tags by ocurrence. Any idea of how I can do it?

    Read the article

  • Right-click acts too fast - No Fix Yet, Any Workaround?

    - by Aahan Krish
    When I click the right mouse button (anywhere, be it - desktop, browser, console, etc.), the right-click context menu pops up so quickly that the very *first* option in the menu gets clicked. This happens too often to take it easy. This issue has been brought up a couple of times on Ask Ubuntu, but with no fix whatsoever. This is a very low priority issue for the Ubuntu team, I believe? (How could they?!) Is there at least a workaround for the issue? Ubuntu is almost unusable for me as it is now. PS: I have a new mouse. So, please don't go about suggesting that I get a new one - - everything's working fine on Windows 7, so should be the case with ubuntu 11.10, which it is not.

    Read the article

  • Right-click In Ubuntu 11.10 Acts Too Fast - No Fix Yet, Any Workaround?

    - by badlearner
    When I click the right mouse button (anywhere, be it - desktop, browser, console, etc.), the right-click context menu pops up so quickly that the very option in the menu gets clicked. This happens to often to take it easy. This issue has been brought up a couple of times on Ask Ubuntu, but with no fix whatsoever. This is a very low priority issue for the Ubuntu team I believe? (How could they?!) Is there at least a workaround for the issue? Ubuntu is almost unusable for me as it is now. PS: I have a new mouse. So, please don't go about suggesting that I get a new one - - everything's working fine on Windows 7, so should be the case with ubuntu 11.10, which it is not.

    Read the article

  • acts_as_revisable 'loses' previous models created before migration

    - by cbrulak
    I have the following the standard, regular post sample app. I created some posts then decided to introduce acts_as_revisable After following the instructions at http://github.com/rich/acts_as_revisable I see that the previous posts are not appearing in the Post.all call. However, if I use the console and do Post.find_by_sql("SELECT * FROM Post WHERE ID=1") the post shows up. Any ideas? Thanks

    Read the article

  • ordering an acts_as_tree relationship

    - by timpone
    I have a Category class that is defined like this: class Catergoy < ActiveRecord::Base acts_as_tree :parent_id I'd like the ordering to be by the position value which is a float such that: category-1 category-2, parent_id=1, position=0.5 category-3, parent_id=2, category-4, parent_id=1, position=1 How would I specify this? I tried acts_as_tree :parent_id :order => :position acts_as_tree :parent_id, :order => :position but these are not working. Any ideas how to specify this relationship? Or if I'm missing something else? thx in advance

    Read the article

  • need help with acts_as_ferret and will_paginate to play nice together

    - by ironmantis7x
    I have installed will_paginate and acts_as_ferret on my system for ruby rails. My paginate seems to work fine before installing acts_as_ferret. When I put in the code to do searching I get the following error: NoMethodError in Community#search Showing app/views/community/_result_summary.rhtml where line #3 raised: undefined method `total_entries' for []:Array Extracted source (around line #3): 1: <% if @users %> 2: <p> 3: Found <%= pluralize(@users.total_entries, "match") %>. 4: </p> 5: <% end %> If I take out the search function, paginate works but it's pointless because I can't do searches. Can any one help me out on this one?? Thanks!! Stephen

    Read the article

  • Is there a better acts_as_commentable for Rails?

    - by levi rosol
    Here's what I'm looking to do. I have a site where I want the user to be able to leave comments on various Models. acts_as_commentable is the obvious starting point for this, but I'm curious if there is a gem / plug-in with a more robust feature-set. For example: Pre-built partial(s) (w/ or w/o Twitter / FB buttons) Partial(s) that utilize jQuery Twitter and / or FB tunnels (push to the users twitter / FB when they comment) Pre-built mechanism for pushing other users comments to users viewing that Model I can see how some of this functionality could be app specific, however, a generic implementation seems like it would be useful. I'm curious if something like this exists or not.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >