I'm generating jQuery UI slider elements in a Rails helper:
def add_link(form_builder, method)
link_to_function 'Add' do |page|
page << "$(\"div#range\"+new_id+\"\").slider({
range: true,
min: 1,
max: 7,
values: [parseInt($(\"#lecture_events_attributes_\"+new_id+\"_from_block\").val()), parseInt($(\"#lect...
I have a link_to_remote function that updates columns in a table. However, it does not properly update the cell or its properties.
For example:
Here is the element I am updating:
<div id= "calendar_div_<%= i%>_<%=j%>" style = "display :inline;"><td class="checkedout">X</td></div>
Using this call:
<%= link_to_remote 'Current Wee...
Hello,
i have a model named 'chapter' (whose only attributes are 'name' and 'course__id') which belongs to "course" (and a course has_many chapters). on the course 'Show' view, I list all chapters for that course. Easy.
I want to add a form at the end of the list so that a user can easily create a new chapter.
so in my controller, I've...
I have to create a Rails migration which creates many triggers and stored procedures.
Normally one would do that using the execute method, but because of the size of the statements, I'd rather keep them in an external file and reference it from the migration.
How can I do that? Is it even possible?
...
One of my rails apps (using passenger and apache) is changing server hosts. I've got the app running on both servers (the new one in testing) and the DNS TTL to 5 minutes. I've been told (and experienced something like this myself) by a colleague that sometimes DNS resolvers slightly ignore the TTL and may have the old IP cached for some...
I setup a remote connection locally and need to push it to heroku. When I pushed it to heroku I got an error saying:
RemoteDBName is not configured.
I'm just assuming (also searched and saw) heroku uses their own config.yml file.
...
Have Addresses and Lists with many-to-many relationship, as shown below.
Sometimes need all the Lists an Address is not in.
Using the find_by_sql query shown, and it works great. But is there a way to do it without using direct SQL?
class List
has_many :address_list_memberships
has_many :addresses, :through => :address_list_member...
I need to be able to match prospective owners to abandoned animals based on varying criteria and locations.
The owner will have a particular criteria set. Animal type = "dog", breed = "Labrador Retriever", age will need to be between 1 and 5, sex = male, and so on...
The animal will also have a particular criteria set. The animal type ...
I have read a bunch of stuff saying that one con of using the cookie store in a Rails app is that the client can see the cookie data. However, I looked at the cookie data and it is encrypted. Is it relatively easy to decrypt the cookie data?
...
If a server always responds with 204 after a successful HTTP DELETE, when is it appropriate to require clients to send an Accept header?
It seems like the correct behavior would be to never require an Accept header.
The reason I ask is that when developing a RESTful Rails application, if the Accept header is unset, Rails defaults to HT...
I'm still pretty new to Rails and need your help: I have been creating a social fitness analytics site (zednine.com) that has an activity stream that lists workouts posted on the site. Several pages currently show the 10 most recently updated workouts. I'd like to add a link at the bottom to "Older workouts." On click, this should show t...
I have 3 classes related by habtm associations...Users, Locations, Employees.
Users is related to Locations via a habtm relationship, and Locations is related to Employees via a habtm relationship.
What I would like to be able to do is say:
current_user.locations.employees
Does anyone know the "Rails Way" to do this? I can do it in ...
Currently I have Steps which belong to Procedures:
map.resources :procedures, :has_many => :steps
And this works fine for me, I get URLs that look like /procedures/3/steps/5.
However, suppose I wanted to add one more layer, Figures that belong to steps, to get this: /procedures/3/steps/5/figures/1
That being a monster of a URL aside...
Ok this is a bit unusual, but I have a series of data collection forms that save data to their respective models. What I want to do is auto insert a common parent (activity/event log - separate model) record that will be common to each form. (All forms will save an implicit record in this model, before saving the child record). So the sa...
Hi,
I have 2 models 'item' and 'activity'. An 'item' can have many 'activities' (limited number of activities, used by all items).
To make it clearer: this is represented by a table with one item per row, one activity per column and something/nothing on the intersection if a line exists in the table matrices.
to see an image (worth a 1...
This is basically a nested form question, albeit with only one field that belongs to a parent model. My data entry form collects data for a model - however I also need to collect one other a data element/value (UserID) that actually goes into a parent record that will be created with the detail record.
AFAIK Rails expects each form fie...
I want to add a twitter feed for a specific keyword search to my rails application. Where should I start?
...
My company has this Huge Database that gets fed with (many) events from multiple sources, for monitoring and reporting purposes. So far, every new dashboard or graphic from the data is a new Rails app with extra tables in the Huge Database and full access to the database contents.
Lately, there has been an idea floating around of having...
Rails cookies,
i need to set start date and expire date using cookie,
for eg., once the added item reaches third day, the item should expire.
...
am passing the hash in radio button option in my view like
<% @h[k].each do |val| %>
<%= radio_button_tag(k, val)%>
<%= val %>
<% end %>
while selcting the radio buttons it passes the hash ( keys and values) to the database..
how can i access the the passed parameter in controller.
inorder to update the count field based on...