Frames in Rails

Hi,

I need the information to create frames in erb rails.

I need to display the links in a frames instead of provide as link to new window.

Eg.

<a href="taxas?[gm]=<%= [prefer.name](http://prefer.name) %>&[sp]=<%= prefer.sp%>" target="new">Link </a>

This should be modified as

<frameset rows="25%,75%">
<frame src="taxas?[gm]=<%= [prefer.name](http://prefer.name) %>&[sp]=<%= prefer.sp %>"> </frame>.

</frameset>

I dont need to open a html or new file. The source file will be same and params will be changed.

Kindly correct the above frameset operations. Its not creating frames. Kindly suggest me your vision on this issue.

Step back and ask yourself what problem you are intending to solve by using frames. If it's a user interface thing (scrolling area within a larger page) then you can solve that easily with CSS. If it's accessing one view within another, then look into partials -- this can be a very elegant way to solve this problem within a single flat page.

Frames are such a mess to work with in any case, both for you and your users, because they don't provide a single URL for a single view. Your Rails app would have to create an outer frameset page, then a separate frame src page for each pane of that frameset. What holds these together? What signals the default content for each sub-frame? If you've got any sort of dynamic content happening within these frames, what method are you using to glue them all together? If the user updates one frame, how does that signal back to the others (if any updates are necessary)? If the user updates one frame or navigates within that frame, can she ever get back to a default page showing this combination of information?

Please say a little more about your application, what it does, and why frames are the solution in your case.

Thanks,

Walter

Hi Walter,

Your suggestion and queries are valuable. I accept your suggestion over frames.

As u asked the main problem,

Main requirement → render the same source with different params in a single page as second table output. I tried with

render : ‘index’, :params => {:gm => prefer.name, :sp => sp}.

But I am getting “double rendering error”. As render option fails with above requirement, I choosed frames to render the different params to execute with same source. If you have idea to render the same source file with different params, Kindly give me suggestion.

Main requirement -> render the same source with different params in a single page as second table output. I tried with

render : 'index', :params => {:gm => prefer.name, :sp => sp}.

But I am getting "double rendering error". As render option fails with above requirement, I choosed frames to render the different params to execute with same source. If you have idea to render the same source file with different params, Kindly give me suggestion.

split your output into partials? Then from your view you can render your various partials in as many different ways that are needed

Fred

If you're working in TextMate, there's a macro built in that will do this for you. Highlight a section of the main view, choose Bundles/Ruby on Rails/ERb Templates/Create Partial From Selection. It will prompt you for a partial name, then replace the snippet with a proper render call and create the properly-named partial in one go.

Blammo. Done.

Walter

Walter Davis wrote in post #957778:

Frames are such a mess to work with in any case, both for you and your users, because they don't provide a single URL for a single view.

Also, frames on certain devices (e.g. iPhone) can be more than a "mess to work with." Make every effort to avoid them.

Hello Walter Davis, I donot need ant dynamic content processings among the frames. i need to display to different independent static views(pages) How am i supposed to do that?

Do you understand how to write a frameset page by hand? You can make one in a Rails View, just like any other type of HTML. You'll need to specify that you don't want a template, and you'll need to work out how you want to transfer your various URLs (one per frame) to the frameset page, but that's really just a data-marshalling exercise. Start by writing the frameset you want to end up with as a single HTML file. Make sure it works without Rails. Then start pulling out the very few bits of data you need to use Rails to provide, and figure out what your controller will need to look like to provide those bits. You should be able to walk backwards into having Rails generate the frameset if you start there.

Walter

This is what I am using in one of my projects. It should't be problem to make it in erb.