Hello everyone, I'm writing a Rails app which includes ajax functionality using jQuery. I hope you guys could help me out here.
For example, in my /public/javascripts/application.js :
/* application.js */
...
$('.item-edit').editable('/item/update', {
name : $(this).attr('name'),
id : $(this).attr('id'),
cancel : 'Can...
Hi, I'm building a Rails application which uses Authlogic for authentication, which I've now set-up to run using the OAuth extension, meaning a user can be created by signing in from Twitter.
This stores their OAuth token and OAuth secret, meaning they're accessible, but I was wondering how I would actually go about sending a tweet usin...
So I'm working on a large rails app that has a bunch of selenium tests. Running a local dev instance of the site (apache w/ mod_passenger) works fine, but when I run the selenium test suite I get a bunch of failures, particularly on re-directs. The HTTP response header comes back poorly formatted. Among other problems the Set-Cookie h...
Specifically, I want to add an spatial index in a multi_polygon column. This works nicely in PostgreSQL but not in MySQL, so I was thinking of somthing like:
create_table :figures do |t|
t.multi_polygon :polygon
end
add_index :figures, :polygon if database_adapter == :postgresql
Is it possible and a good idea?
...
Hi All,
In our application we have different themes and each theme has its own default content in the following structure:
ROWS
COLUMNS
CONTENT
HTML DATA 1
CONTENT
HTML DATA 2
There could be multiple rows, column and content elements. We need to store this data in a file (manually) and then read & dump it ...
I'm able to create an event via the Facebook Graph API but I have yet to see a way in which to invite users to that event.
My fallback is to simply use the old REST API but sooner or later that will be phased out so I wanted to see if anyone had any suggestions.
--
Additional side question:
While using the REST API (or possibly even...
I am creating locale files for internationalization in a rails app, and have a url that I want translated with tags included , for example
html.erb
<%= t(foo.bar.xxxx) %>
yml file
foo: bar:
xxxx: "xxxx"
result
< ;a href=
"/info/index.html"> ;xxxx</a> ;
which breaks my links. I do not have an h on th...
Hi everyone. I've setup a system to automatically download and store a db dump from my Heroku deployed rails app. Everything is working great but when I download the dump and restore it to my local postgres server then try and run my local app off that restored database I get this error
ActiveRecord::StatementInvalid in HomeController#i...
I've worked through some of the Sinatra and Rails samples, but I'm having a hard time figuring out which features belong to which technology.
What specifically do I gain by using Sinatra/Rails? Is it just ActionPack/ActionView? Correct me if I'm wrong, but I COULD just use Webrick/Mongrel and serve up my .erb files right? And I could us...
Hi everyone,
I'd like my users to be able to use Google Translate with my Rails apps. I have forms and login for the app. I keep getting the Rails InvalidAuthenticityToken when using the app through Google Translate.
Any insights on how i can get both to work? I am using Rails 2.5.x.
Thank you!
PS: To clarify, this the authenticity t...
Hi all,
I'm developing an application in which a Course belongs to a user. I would like to predefine a number of courses, such that a Course's template details are then copied into the users course details. From this initial point each user has a one-to-one mapping with a course.
I'd like to know the best place for the static attribut...
Hi,
Is there any Eclipse plugin for writing features for cucumber with autocomplete functionality?
I guess that would be good to find and reuse steps from other features. Any ideas?
...
Is it possible to detect the last character of string in ruby on rails and replace it by "".
Explanation :: Suppose I have string as "demo-" then i have to check its last character, If it is "-" then replace it by "", otherwise no action should be taken.
Example - Code ::
search_text.downcase! if !search_text.nil?
now if seach_text h...
Hi everybody,
I would like to know which way is the best to resolve my question :
I have a form in order to select people via a select field. If the name is missing in the select field, a text field is available to add directly the person's name.
- The form in new.html.erb is the format of the new action of the Team controller.
- The lis...
Below I have outlined the structure of a polymorphic association.
In VacationsController I put some comments inline describing my current issue. However, I wanted to post this to see if my whole approach here is a little off. You can see in business_vacations_controller and staff_vacations_controller that I've had to make 'getters' for ...
Hi All,
I have a nested form that is based on the following model -- A lesson has many questions, each question has many answers, and answers belong to users.
I am developing a nested form, so that a new user can review the questions and post answers. If a user has entered answers in the past, I want those to show up; otherwise show ...
I have a build task in rake defined with the following dependencies:
desc 'Builds the App'
task :rebuild_dev => ["solr:start", "db:drop", "db:create", "db:migrate", "spec", "solr:stop"]
The first task "solr:start" starts the Solr Indexing server. Now, if the build fails (may be in spec tests fail), the "solr:stop" task is not executed...
Hello, I have the following in a form:
<%= f.hidden_field (:project_id, :value => @project.id) %>
This form partial sometimes contains a @project. Sometimes it does not. This is the nature of the app.
But I want to use one partial because it's a big form. Problem here is if it does not contain @project, the page ERRORS....
How can I...
I want to be able to create multiple user accounts with the same login (because of the case a user deletes his account... and then sign up with the same login). I am using authlogic and rails3_acts_as_paranoid.
But there is a problem: Authlogic validates the uniqueness of the login field - and IGNORES the default_scope(:conditions => {:...
Hello, tricky problem.
I have a controller that is:
def create
.
.
@project = Project.find(params[:project]
@Log = Logs.create(params[:action]).merge(:project_id => @project.id))
...
end
The issue hereis that sometimes when DEF CREATE, I'll have a project and I want to record that. Other times I won't and that's perfectly fine, I st...